summaryrefslogtreecommitdiff
path: root/avconv_opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-08-14 08:56:32 +0200
committerAnton Khirnov <anton@khirnov.net>2012-08-19 19:23:17 +0200
commit6e3857fa8cd620d528fb73fe5f7f692db780c4df (patch)
tree44d77ab679c59670b231f3cee25713af6c53e40c /avconv_opt.c
parentf8b1e665539010d3ca148f09cb1203c20c1ca174 (diff)
avconv: refactor help printing.
By default don't dump every single option on the user, but print only the basic options. Add -h long/full to print more options.
Diffstat (limited to 'avconv_opt.c')
-rw-r--r--avconv_opt.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/avconv_opt.c b/avconv_opt.c
index 2bcce3bbad..7d4922c375 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1791,30 +1791,56 @@ static int opt_filter_complex(const char *opt, const char *arg)
void show_help_default(const char *opt, const char *arg)
{
- int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
+ int show_advanced = 0, show_avoptions = 0;
+
+ if (opt) {
+ if (!strcmp(opt, "long"))
+ show_advanced = 1;
+ else if (!strcmp(opt, "full"))
+ show_advanced = show_avoptions = 1;
+ else
+ av_log(NULL, AV_LOG_ERROR, "Unknown help option '%s'.\n", opt);
+ }
show_usage();
+
+ printf("Getting help:\n"
+ " -h -- print basic options\n"
+ " -h long -- print more options\n"
+ " -h full -- print all options (including all format and codec specific options, very long)\n"
+ " See man %s for detailed description of the options.\n"
+ "\n", program_name);
+
show_help_options(options, "Print help / information / capabilities:",
OPT_EXIT, 0);
show_help_options(options, "Main options:",
0, OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE |
OPT_EXIT);
- show_help_options(options, "Advanced options:",
- OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE);
+ if (show_advanced)
+ show_help_options(options, "Advanced options:",
+ OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE);
+
show_help_options(options, "Video options:",
OPT_VIDEO, OPT_EXPERT | OPT_AUDIO);
- show_help_options(options, "Advanced Video options:",
- OPT_EXPERT | OPT_VIDEO, OPT_AUDIO);
+ if (show_advanced)
+ show_help_options(options, "Advanced Video options:",
+ OPT_EXPERT | OPT_VIDEO, OPT_AUDIO);
+
show_help_options(options, "Audio options:",
OPT_AUDIO, OPT_EXPERT | OPT_VIDEO);
- show_help_options(options, "Advanced Audio options:",
- OPT_EXPERT | OPT_AUDIO, OPT_VIDEO);
+ if (show_advanced)
+ show_help_options(options, "Advanced Audio options:",
+ OPT_EXPERT | OPT_AUDIO, OPT_VIDEO);
show_help_options(options, "Subtitle options:",
OPT_SUBTITLE, 0);
printf("\n");
- show_help_children(avcodec_get_class(), flags);
- show_help_children(avformat_get_class(), flags);
- show_help_children(sws_get_class(), flags);
+
+ if (show_avoptions) {
+ int flags = AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM;
+ show_help_children(avcodec_get_class(), flags);
+ show_help_children(avformat_get_class(), flags);
+ show_help_children(sws_get_class(), flags);
+ }
}
void show_usage(void)