mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-18 08:56:45 -05:00
clean up options
make sure we can use -v for verbose mode
This commit is contained in:
parent
1fd5be7101
commit
b87c0a9270
8 changed files with 102 additions and 104 deletions
|
|
@ -44,7 +44,7 @@ static void show_help(const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "%s [options]\n"
|
fprintf(stdout, "%s [options]\n"
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" -v, --version Show version\n"
|
" --version Show version\n"
|
||||||
" -n, --name Daemon name (Default %s)\n",
|
" -n, --name Daemon name (Default %s)\n",
|
||||||
name,
|
name,
|
||||||
daemon_name);
|
daemon_name);
|
||||||
|
|
@ -58,21 +58,22 @@ int main(int argc, char *argv[])
|
||||||
struct pw_properties *properties;
|
struct pw_properties *properties;
|
||||||
char *err = NULL;
|
char *err = NULL;
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{"version", 0, NULL, 'v'},
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{"name", 1, NULL, 'n'},
|
{ "name", required_argument, NULL, 'n' },
|
||||||
|
|
||||||
{ NULL, 0, NULL, 0}
|
{ NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
int c, res;
|
int c, res;
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hvn:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "hVn:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h' :
|
case 'h' :
|
||||||
show_help(argv[0]);
|
show_help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
case 'v' :
|
case 'V' :
|
||||||
fprintf(stdout, "%s\n"
|
fprintf(stdout, "%s\n"
|
||||||
"Compiled with libpipewire %s\n"
|
"Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
|
|
|
||||||
|
|
@ -1726,7 +1726,7 @@ static void show_help(const char *name)
|
||||||
|
|
||||||
fprintf(stdout, "%s [options]\n"
|
fprintf(stdout, "%s [options]\n"
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" -v, --version Show version\n"
|
" --version Show version\n"
|
||||||
" -e, --enabled Enabled options (default '%s')\n"
|
" -e, --enabled Enabled options (default '%s')\n"
|
||||||
" -d, --disabled Disabled options (default '%s')\n"
|
" -d, --disabled Disabled options (default '%s')\n"
|
||||||
" -p, --properties Extra properties as 'key=value { key=value }'\n",
|
" -p, --properties Extra properties as 'key=value { key=value }'\n",
|
||||||
|
|
@ -1749,11 +1749,11 @@ int main(int argc, char *argv[])
|
||||||
const char *opt_disabled = DEFAULT_DISABLED;
|
const char *opt_disabled = DEFAULT_DISABLED;
|
||||||
const char *opt_properties = NULL;
|
const char *opt_properties = NULL;
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{"version", 0, NULL, 'v'},
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{"enabled", 1, NULL, 'e'},
|
{ "enabled", required_argument, NULL, 'e' },
|
||||||
{"disabled", 1, NULL, 'd'},
|
{ "disabled", required_argument, NULL, 'd' },
|
||||||
{"properties", 1, NULL, 'p'},
|
{ "properties", required_argument, NULL, 'p' },
|
||||||
{ NULL, 0, NULL, 0}
|
{ NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
@ -1761,12 +1761,12 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hve:d:p:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "hVe:d:p:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
show_help(argv[0]);
|
show_help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
case 'v':
|
case 'V':
|
||||||
fprintf(stdout, "%s\n"
|
fprintf(stdout, "%s\n"
|
||||||
"Compiled with libpipewire %s\n"
|
"Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
|
|
|
||||||
|
|
@ -902,6 +902,7 @@ static void show_usage(const char *name, bool is_error)
|
||||||
fprintf(fp,
|
fprintf(fp,
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" --version Show version\n"
|
" --version Show version\n"
|
||||||
|
" -v, --verbose Enable verbose operations\n"
|
||||||
"\n");
|
"\n");
|
||||||
|
|
||||||
fprintf(fp,
|
fprintf(fp,
|
||||||
|
|
@ -945,10 +946,6 @@ static void show_usage(const char *name, bool is_error)
|
||||||
" -m, --midi Midi mode\n"
|
" -m, --midi Midi mode\n"
|
||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp,
|
|
||||||
" -v, --verbose Enable verbose operations\n"
|
|
||||||
"\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int midi_play(struct data *d, void *src, unsigned int n_frames)
|
static int midi_play(struct data *d, void *src, unsigned int n_frames)
|
||||||
|
|
|
||||||
|
|
@ -2749,7 +2749,7 @@ static void show_help(struct data *data, const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "%s [options] [command]\n"
|
fprintf(stdout, "%s [options] [command]\n"
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" -v, --version Show version\n"
|
" --version Show version\n"
|
||||||
" -d, --daemon Start as daemon (Default false)\n"
|
" -d, --daemon Start as daemon (Default false)\n"
|
||||||
" -r, --remote Remote daemon name\n\n",
|
" -r, --remote Remote daemon name\n\n",
|
||||||
name);
|
name);
|
||||||
|
|
@ -2765,22 +2765,22 @@ int main(int argc, char *argv[])
|
||||||
char *error;
|
char *error;
|
||||||
bool daemon = false;
|
bool daemon = false;
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{"version", 0, NULL, 'v'},
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{"daemon", 0, NULL, 'd'},
|
{ "daemon", no_argument, NULL, 'd' },
|
||||||
{"remote", 1, NULL, 'r'},
|
{ "remote", required_argument, NULL, 'r' },
|
||||||
{ NULL, 0, NULL, 0}
|
{ NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
int c, i;
|
int c, i;
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hvdr:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "hVdr:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
show_help(&data, argv[0]);
|
show_help(&data, argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
case 'v':
|
case 'V':
|
||||||
fprintf(stdout, "%s\n"
|
fprintf(stdout, "%s\n"
|
||||||
"Compiled with libpipewire %s\n"
|
"Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
|
|
|
||||||
|
|
@ -747,7 +747,7 @@ static void show_help(const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "%s [options]\n"
|
fprintf(stdout, "%s [options]\n"
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" -v, --version Show version\n"
|
" --version Show version\n"
|
||||||
" -a, --all Show all object types\n"
|
" -a, --all Show all object types\n"
|
||||||
" -s, --smart Show linked objects only\n"
|
" -s, --smart Show linked objects only\n"
|
||||||
" -d, --detail Show all object properties\n"
|
" -d, --detail Show all object properties\n"
|
||||||
|
|
@ -764,25 +764,25 @@ int main(int argc, char *argv[])
|
||||||
const char *opt_remote = NULL;
|
const char *opt_remote = NULL;
|
||||||
const char *dot_path = DEFAULT_DOT_PATH;
|
const char *dot_path = DEFAULT_DOT_PATH;
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{"version", 0, NULL, 'v'},
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{"all", 0, NULL, 'a'},
|
{ "all", no_argument, NULL, 'a' },
|
||||||
{"smart", 0, NULL, 's'},
|
{ "smart", no_argument, NULL, 's' },
|
||||||
{"detail", 0, NULL, 'd'},
|
{ "detail", no_argument, NULL, 'd' },
|
||||||
{"remote", 1, NULL, 'r'},
|
{ "remote", required_argument, NULL, 'r' },
|
||||||
{"output", 1, NULL, 'o'},
|
{ "output", required_argument, NULL, 'o' },
|
||||||
{ NULL, 0, NULL, 0}
|
{ NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hvasdr:o:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "hVasdr:o:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h' :
|
case 'h' :
|
||||||
show_help(argv[0]);
|
show_help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
case 'v' :
|
case 'V' :
|
||||||
fprintf(stdout, "%s\n"
|
fprintf(stdout, "%s\n"
|
||||||
"Compiled with libpipewire %s\n"
|
"Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
|
|
|
||||||
|
|
@ -683,7 +683,7 @@ static void show_help(const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "%s [options]\n"
|
fprintf(stdout, "%s [options]\n"
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" -v, --version Show version\n"
|
" --version Show version\n"
|
||||||
" -r, --remote Remote daemon name\n",
|
" -r, --remote Remote daemon name\n",
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
@ -694,21 +694,21 @@ int main(int argc, char *argv[])
|
||||||
struct pw_loop *l;
|
struct pw_loop *l;
|
||||||
const char *opt_remote = NULL;
|
const char *opt_remote = NULL;
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{"version", 0, NULL, 'v'},
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{"remote", 1, NULL, 'r'},
|
{ "remote", required_argument, NULL, 'r' },
|
||||||
{ NULL, 0, NULL, 0}
|
{ NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hvr:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "hVr:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
show_help(argv[0]);
|
show_help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
case 'v':
|
case 'V':
|
||||||
fprintf(stdout, "%s\n"
|
fprintf(stdout, "%s\n"
|
||||||
"Compiled with libpipewire %s\n"
|
"Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,7 @@ static void show_help(const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "%s [options]\n"
|
fprintf(stdout, "%s [options]\n"
|
||||||
" -h, --help Show this help\n"
|
" -h, --help Show this help\n"
|
||||||
" -v, --version Show version\n"
|
" --version Show version\n"
|
||||||
" -r, --remote Remote daemon name\n"
|
" -r, --remote Remote daemon name\n"
|
||||||
" -o, --output Profiler output name (default \"%s\")\n",
|
" -o, --output Profiler output name (default \"%s\")\n",
|
||||||
name,
|
name,
|
||||||
|
|
@ -556,22 +556,22 @@ int main(int argc, char *argv[])
|
||||||
const char *opt_remote = NULL;
|
const char *opt_remote = NULL;
|
||||||
const char *opt_output = DEFAULT_FILENAME;
|
const char *opt_output = DEFAULT_FILENAME;
|
||||||
static const struct option long_options[] = {
|
static const struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{"version", 0, NULL, 'v'},
|
{ "version", no_argument, NULL, 'V' },
|
||||||
{"remote", 1, NULL, 'r'},
|
{ "remote", required_argument, NULL, 'r' },
|
||||||
{"output", 1, NULL, 'o'},
|
{ "output", required_argument, NULL, 'o' },
|
||||||
{ NULL, 0, NULL, 0}
|
{ NULL, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hvr:o:", long_options, NULL)) != -1) {
|
while ((c = getopt_long(argc, argv, "hVr:o:", long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
show_help(argv[0]);
|
show_help(argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
case 'v':
|
case 'V':
|
||||||
fprintf(stdout, "%s\n"
|
fprintf(stdout, "%s\n"
|
||||||
"Compiled with libpipewire %s\n"
|
"Compiled with libpipewire %s\n"
|
||||||
"Linked with libpipewire %s\n",
|
"Linked with libpipewire %s\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue