diff --git a/spa/plugins/audioconvert/spa-resample.c b/spa/plugins/audioconvert/spa-resample.c index 2cb0e3240..78eabeb92 100644 --- a/spa/plugins/audioconvert/spa-resample.c +++ b/spa/plugins/audioconvert/spa-resample.c @@ -63,14 +63,14 @@ struct data { #define OPTIONS "hvr:f:q:" static const struct option long_options[] = { - {"help", no_argument, NULL, 'h'}, - {"verbose", no_argument, NULL, 'v'}, + { "help", no_argument, NULL, 'h'}, + { "verbose", no_argument, NULL, 'v'}, - {"rate", required_argument, NULL, 'r' }, - {"format", required_argument, NULL, 'f' }, - {"quality", required_argument, NULL, 'q' }, + { "rate", required_argument, NULL, 'r' }, + { "format", required_argument, NULL, 'f' }, + { "quality", required_argument, NULL, 'q' }, - {NULL, 0, NULL, 0 } + { NULL, 0, NULL, 0 } }; static void show_usage(const char *name, bool is_error) diff --git a/src/daemon/main.c b/src/daemon/main.c index d5074ebac..081036f1a 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -43,11 +43,11 @@ static void do_quit(void *data, int signal_number) static void show_help(const char *name) { fprintf(stdout, "%s [options]\n" - " -h, --help Show this help\n" - " -v, --version Show version\n" - " -n, --name Daemon name (Default %s)\n", - name, - daemon_name); + " -h, --help Show this help\n" + " --version Show version\n" + " -n, --name Daemon name (Default %s)\n", + name, + daemon_name); } int main(int argc, char *argv[]) @@ -58,21 +58,22 @@ int main(int argc, char *argv[]) struct pw_properties *properties; char *err = NULL; static const struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"version", 0, NULL, 'v'}, - {"name", 1, NULL, 'n'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { "name", required_argument, NULL, 'n' }, + + { NULL, 0, NULL, 0} }; int c, res; 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) { case 'h' : show_help(argv[0]); return 0; - case 'v' : + case 'V' : fprintf(stdout, "%s\n" "Compiled with libpipewire %s\n" "Linked with libpipewire %s\n", diff --git a/src/examples/media-session/media-session.c b/src/examples/media-session/media-session.c index c03c40a35..b9624e05f 100644 --- a/src/examples/media-session/media-session.c +++ b/src/examples/media-session/media-session.c @@ -1726,7 +1726,7 @@ static void show_help(const char *name) fprintf(stdout, "%s [options]\n" " -h, --help Show this help\n" - " -v, --version Show version\n" + " --version Show version\n" " -e, --enabled Enabled options (default '%s')\n" " -d, --disabled Disabled options (default '%s')\n" " -p, --properties Extra properties as 'key=value { key=value }'\n", @@ -1749,24 +1749,24 @@ int main(int argc, char *argv[]) const char *opt_disabled = DEFAULT_DISABLED; const char *opt_properties = NULL; static const struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"version", 0, NULL, 'v'}, - {"enabled", 1, NULL, 'e'}, - {"disabled", 1, NULL, 'd'}, - {"properties", 1, NULL, 'p'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { "enabled", required_argument, NULL, 'e' }, + { "disabled", required_argument, NULL, 'd' }, + { "properties", required_argument, NULL, 'p' }, + { NULL, 0, NULL, 0} }; size_t i; const struct spa_dict_item *item; 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) { case 'h': show_help(argv[0]); return 0; - case 'v': + case 'V': fprintf(stdout, "%s\n" "Compiled with libpipewire %s\n" "Linked with libpipewire %s\n", diff --git a/src/tools/pw-cat.c b/src/tools/pw-cat.c index f17fbddc0..703c6316e 100644 --- a/src/tools/pw-cat.c +++ b/src/tools/pw-cat.c @@ -863,32 +863,32 @@ enum { }; static const struct option long_options[] = { - {"help", no_argument, NULL, 'h'}, - {"version", no_argument, NULL, OPT_VERSION}, - {"verbose", no_argument, NULL, 'v'}, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, OPT_VERSION}, + { "verbose", no_argument, NULL, 'v' }, - {"record", no_argument, NULL, 'r'}, - {"playback", no_argument, NULL, 's'}, - {"midi", no_argument, NULL, 'm'}, + { "record", no_argument, NULL, 'r' }, + { "playback", no_argument, NULL, 's' }, + { "midi", no_argument, NULL, 'm' }, - {"remote", required_argument, NULL, 'R'}, + { "remote", required_argument, NULL, 'R' }, - {"media-type", required_argument, NULL, OPT_MEDIA_TYPE }, - {"media-category", required_argument, NULL, OPT_MEDIA_CATEGORY }, - {"media-role", required_argument, NULL, OPT_MEDIA_ROLE }, - {"target", required_argument, NULL, OPT_TARGET }, - {"latency", required_argument, NULL, OPT_LATENCY }, + { "media-type", required_argument, NULL, OPT_MEDIA_TYPE }, + { "media-category", required_argument, NULL, OPT_MEDIA_CATEGORY }, + { "media-role", required_argument, NULL, OPT_MEDIA_ROLE }, + { "target", required_argument, NULL, OPT_TARGET }, + { "latency", required_argument, NULL, OPT_LATENCY }, - {"rate", required_argument, NULL, OPT_RATE }, - {"channels", required_argument, NULL, OPT_CHANNELS }, - {"channel-map", required_argument, NULL, OPT_CHANNELMAP }, - {"format", required_argument, NULL, OPT_FORMAT }, - {"volume", required_argument, NULL, OPT_VOLUME }, - {"quality", required_argument, NULL, 'q' }, + { "rate", required_argument, NULL, OPT_RATE }, + { "channels", required_argument, NULL, OPT_CHANNELS }, + { "channel-map", required_argument, NULL, OPT_CHANNELMAP }, + { "format", required_argument, NULL, OPT_FORMAT }, + { "volume", required_argument, NULL, OPT_VOLUME }, + { "quality", required_argument, NULL, 'q' }, - {"list-targets", no_argument, NULL, OPT_LIST_TARGETS }, + { "list-targets", no_argument, NULL, OPT_LIST_TARGETS }, - {NULL, 0, NULL, 0 } + { NULL, 0, NULL, 0 } }; static void show_usage(const char *name, bool is_error) @@ -902,6 +902,7 @@ static void show_usage(const char *name, bool is_error) fprintf(fp, " -h, --help Show this help\n" " --version Show version\n" + " -v, --verbose Enable verbose operations\n" "\n"); fprintf(fp, @@ -945,10 +946,6 @@ static void show_usage(const char *name, bool is_error) " -m, --midi Midi mode\n" "\n"); } - - fprintf(fp, - " -v, --verbose Enable verbose operations\n" - "\n"); } static int midi_play(struct data *d, void *src, unsigned int n_frames) diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c index 31049ed72..f331ee306 100644 --- a/src/tools/pw-cli.c +++ b/src/tools/pw-cli.c @@ -2748,11 +2748,11 @@ static void do_quit(void *data, int signal_number) static void show_help(struct data *data, const char *name) { fprintf(stdout, "%s [options] [command]\n" - " -h, --help Show this help\n" - " -v, --version Show version\n" - " -d, --daemon Start as daemon (Default false)\n" - " -r, --remote Remote daemon name\n\n", - name); + " -h, --help Show this help\n" + " --version Show version\n" + " -d, --daemon Start as daemon (Default false)\n" + " -r, --remote Remote daemon name\n\n", + name); do_help(data, "help", "", NULL); } @@ -2765,22 +2765,22 @@ int main(int argc, char *argv[]) char *error; bool daemon = false; static const struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"version", 0, NULL, 'v'}, - {"daemon", 0, NULL, 'd'}, - {"remote", 1, NULL, 'r'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { "daemon", no_argument, NULL, 'd' }, + { "remote", required_argument, NULL, 'r' }, + { NULL, 0, NULL, 0} }; int c, i; 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) { case 'h': show_help(&data, argv[0]); return 0; - case 'v': + case 'V': fprintf(stdout, "%s\n" "Compiled with libpipewire %s\n" "Linked with libpipewire %s\n", diff --git a/src/tools/pw-dot.c b/src/tools/pw-dot.c index ed34b0b9d..6c5995fee 100644 --- a/src/tools/pw-dot.c +++ b/src/tools/pw-dot.c @@ -746,15 +746,15 @@ static void do_quit(void *data, int signal_number) static void show_help(const char *name) { fprintf(stdout, "%s [options]\n" - " -h, --help Show this help\n" - " -v, --version Show version\n" - " -a, --all Show all object types\n" - " -s, --smart Show linked objects only\n" - " -d, --detail Show all object properties\n" - " -r, --remote Remote daemon name\n" - " -o, --output Output file (Default %s)\n", - name, - DEFAULT_DOT_PATH); + " -h, --help Show this help\n" + " --version Show version\n" + " -a, --all Show all object types\n" + " -s, --smart Show linked objects only\n" + " -d, --detail Show all object properties\n" + " -r, --remote Remote daemon name\n" + " -o, --output Output file (Default %s)\n", + name, + DEFAULT_DOT_PATH); } int main(int argc, char *argv[]) @@ -764,25 +764,25 @@ int main(int argc, char *argv[]) const char *opt_remote = NULL; const char *dot_path = DEFAULT_DOT_PATH; static const struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"version", 0, NULL, 'v'}, - {"all", 0, NULL, 'a'}, - {"smart", 0, NULL, 's'}, - {"detail", 0, NULL, 'd'}, - {"remote", 1, NULL, 'r'}, - {"output", 1, NULL, 'o'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { "all", no_argument, NULL, 'a' }, + { "smart", no_argument, NULL, 's' }, + { "detail", no_argument, NULL, 'd' }, + { "remote", required_argument, NULL, 'r' }, + { "output", required_argument, NULL, 'o' }, + { NULL, 0, NULL, 0} }; int c; 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) { case 'h' : show_help(argv[0]); return 0; - case 'v' : + case 'V' : fprintf(stdout, "%s\n" "Compiled with libpipewire %s\n" "Linked with libpipewire %s\n", diff --git a/src/tools/pw-mon.c b/src/tools/pw-mon.c index f2eda9e9b..20c765ec9 100644 --- a/src/tools/pw-mon.c +++ b/src/tools/pw-mon.c @@ -682,10 +682,10 @@ static void do_quit(void *data, int signal_number) static void show_help(const char *name) { fprintf(stdout, "%s [options]\n" - " -h, --help Show this help\n" - " -v, --version Show version\n" - " -r, --remote Remote daemon name\n", - name); + " -h, --help Show this help\n" + " --version Show version\n" + " -r, --remote Remote daemon name\n", + name); } int main(int argc, char *argv[]) @@ -694,21 +694,21 @@ int main(int argc, char *argv[]) struct pw_loop *l; const char *opt_remote = NULL; static const struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"version", 0, NULL, 'v'}, - {"remote", 1, NULL, 'r'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { "remote", required_argument, NULL, 'r' }, + { NULL, 0, NULL, 0} }; int c; 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) { case 'h': show_help(argv[0]); return 0; - case 'v': + case 'V': fprintf(stdout, "%s\n" "Compiled with libpipewire %s\n" "Linked with libpipewire %s\n", diff --git a/src/tools/pw-profiler.c b/src/tools/pw-profiler.c index 8b37b8e9b..1931436c7 100644 --- a/src/tools/pw-profiler.c +++ b/src/tools/pw-profiler.c @@ -541,12 +541,12 @@ static void do_quit(void *data, int signal_number) static void show_help(const char *name) { fprintf(stdout, "%s [options]\n" - " -h, --help Show this help\n" - " -v, --version Show version\n" - " -r, --remote Remote daemon name\n" - " -o, --output Profiler output name (default \"%s\")\n", - name, - DEFAULT_FILENAME); + " -h, --help Show this help\n" + " --version Show version\n" + " -r, --remote Remote daemon name\n" + " -o, --output Profiler output name (default \"%s\")\n", + name, + DEFAULT_FILENAME); } int main(int argc, char *argv[]) @@ -556,22 +556,22 @@ int main(int argc, char *argv[]) const char *opt_remote = NULL; const char *opt_output = DEFAULT_FILENAME; static const struct option long_options[] = { - {"help", 0, NULL, 'h'}, - {"version", 0, NULL, 'v'}, - {"remote", 1, NULL, 'r'}, - {"output", 1, NULL, 'o'}, - {NULL, 0, NULL, 0} + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { "remote", required_argument, NULL, 'r' }, + { "output", required_argument, NULL, 'o' }, + { NULL, 0, NULL, 0} }; int c; 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) { case 'h': show_help(argv[0]); return 0; - case 'v': + case 'V': fprintf(stdout, "%s\n" "Compiled with libpipewire %s\n" "Linked with libpipewire %s\n",