diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-12-15 08:24:14 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-12-22 11:39:57 +0100 |
commit | b472c46a7020bfcd74952c04914a929476b701f2 (patch) | |
tree | 3c4182dcd307e3141777dbfda6b32b4f83aa0aa3 /fftools/ffprobe.c | |
parent | 25c98566e8a45b50415c80ca6450282f2ec0657a (diff) |
fftools/cmdutils: simplify handling of the HAS_ARG option flag
This option flag only carries nontrivial information for options that
call a function, in all other cases its presence can be inferred from
the option type (bool options do not have arguments, all other types do)
and is thus nothing but useless clutter.
Change the option parsing code to infer its value when it can, and drop
the flag from options where it's not needed.
Diffstat (limited to 'fftools/ffprobe.c')
-rw-r--r-- | fftools/ffprobe.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 71f6cc3a74..9968603e76 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -4087,21 +4087,21 @@ static const OptionDef real_options[] = { "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" }, { "pretty", 0, {.func_arg = opt_pretty}, "prettify the format of displayed values, make it more human readable" }, - { "output_format", OPT_STRING | HAS_ARG, { &output_format }, + { "output_format", OPT_STRING, { &output_format }, "set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)", "format" }, - { "print_format", OPT_STRING | HAS_ARG, { &output_format }, "alias for -output_format (deprecated)" }, - { "of", OPT_STRING | HAS_ARG, { &output_format }, "alias for -output_format", "format" }, - { "select_streams", OPT_STRING | HAS_ARG, { &stream_specifier }, "select the specified streams", "stream_specifier" }, + { "print_format", OPT_STRING, { &output_format }, "alias for -output_format (deprecated)" }, + { "of", OPT_STRING, { &output_format }, "alias for -output_format", "format" }, + { "select_streams", OPT_STRING, { &stream_specifier }, "select the specified streams", "stream_specifier" }, { "sections", OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" }, { "show_data", OPT_BOOL, { &do_show_data }, "show packets data" }, - { "show_data_hash", OPT_STRING | HAS_ARG, { &show_data_hash }, "show packets data hash" }, + { "show_data_hash", OPT_STRING, { &show_data_hash }, "show packets data hash" }, { "show_error", 0, { .func_arg = &opt_show_error }, "show probing error" }, { "show_format", 0, { .func_arg = &opt_show_format }, "show format/container info" }, { "show_frames", 0, { .func_arg = &opt_show_frames }, "show frames info" }, { "show_entries", HAS_ARG, {.func_arg = opt_show_entries}, "show a set of specified entries", "entry_list" }, #if HAVE_THREADS - { "show_log", OPT_INT|HAS_ARG, { &do_show_log }, "show log" }, + { "show_log", OPT_INT, { &do_show_log }, "show log" }, #endif { "show_packets", 0, { .func_arg = &opt_show_packets }, "show packets info" }, { "show_programs", 0, { .func_arg = &opt_show_programs }, "show programs info" }, |