|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
146 |
#define OPT_f 0x80
|
146 |
#define OPT_f 0x80
|
147 |
#define OPT_q 0x100
|
147 |
#define OPT_q 0x100
|
148 |
#define OPT_i 0x200
|
148 |
#define OPT_i 0x200
|
149 |
#define OPT_P 0x400
|
149 |
#define OPT_P 0x400
|
150 |
#define OPT_O 0x800
|
150 |
#define OPT_O 0x800
|
|
|
151 |
#define OPT_v 0x1000
|
151 |
|
152 |
|
152 |
static const char usage[] =
|
153 |
static const char usage[] =
|
153 |
"-c configfile \t configuration file to use\n"
|
154 |
"-c configfile \t configuration file to use\n"
|
154 |
"-h host \t specify host MPD is running on\n"
|
155 |
"-h host \t specify host MPD is running on\n"
|
155 |
"-p port \t specify MPD port\n"
|
156 |
"-p port \t specify MPD port\n"
|
|
... |
|
... |
159 |
"-f friendlyname\t define device displayed name\n"
|
160 |
"-f friendlyname\t define device displayed name\n"
|
160 |
"-q 0|1\t if set, we own the mpd queue, else avoid clearing it whenever we feel like it\n"
|
161 |
"-q 0|1\t if set, we own the mpd queue, else avoid clearing it whenever we feel like it\n"
|
161 |
"-i iface \t specify network interface name to be used for UPnP\n"
|
162 |
"-i iface \t specify network interface name to be used for UPnP\n"
|
162 |
"-P upport \t specify port number to be used for UPnP\n"
|
163 |
"-P upport \t specify port number to be used for UPnP\n"
|
163 |
"-O 0|1\t decide if we run and export the OpenHome services\n"
|
164 |
"-O 0|1\t decide if we run and export the OpenHome services\n"
|
|
|
165 |
"-v \tprint version info\n"
|
164 |
"\n"
|
166 |
"\n"
|
165 |
;
|
167 |
;
|
166 |
|
168 |
|
167 |
static void
|
169 |
static void
|
168 |
Usage(void)
|
170 |
versionInfo(FILE *fp)
|
169 |
{
|
171 |
{
|
|
|
172 |
fprintf(fp, "Upmpdcli %s %s\n",
|
|
|
173 |
UPMPDCLI_PACKAGE_VERSION, LibUPnP::versionString().c_str());
|
|
|
174 |
}
|
|
|
175 |
|
|
|
176 |
static void
|
|
|
177 |
Usage(FILE *fp = stderr)
|
|
|
178 |
{
|
170 |
fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
|
179 |
fprintf(fp, "%s: usage:\n%s", thisprog, usage);
|
|
|
180 |
versionInfo(fp);
|
171 |
exit(1);
|
181 |
exit(1);
|
172 |
}
|
182 |
}
|
|
|
183 |
|
173 |
|
184 |
|
174 |
static const string dfltFriendlyName("UpMpd");
|
185 |
static const string dfltFriendlyName("UpMpd");
|
175 |
|
186 |
|
176 |
// This is global
|
187 |
// This is global
|
177 |
string g_protocolInfo;
|
188 |
string g_protocolInfo;
|
|
... |
|
... |
284 |
upport = atoi(*(++argv)); argc--; goto b1;
|
295 |
upport = atoi(*(++argv)); argc--; goto b1;
|
285 |
case 'p': op_flags |= OPT_p; if (argc < 2) Usage();
|
296 |
case 'p': op_flags |= OPT_p; if (argc < 2) Usage();
|
286 |
mpdport = atoi(*(++argv)); argc--; goto b1;
|
297 |
mpdport = atoi(*(++argv)); argc--; goto b1;
|
287 |
case 'q': op_flags |= OPT_q; if (argc < 2) Usage();
|
298 |
case 'q': op_flags |= OPT_q; if (argc < 2) Usage();
|
288 |
ownqueue = atoi(*(++argv)) != 0; argc--; goto b1;
|
299 |
ownqueue = atoi(*(++argv)) != 0; argc--; goto b1;
|
|
|
300 |
case 'v': versionInfo(stdout); exit(0); break;
|
289 |
default: Usage(); break;
|
301 |
default: Usage(); break;
|
290 |
}
|
302 |
}
|
291 |
b1: argc--; argv++;
|
303 |
b1: argc--; argv++;
|
292 |
}
|
304 |
}
|
293 |
|
305 |
|