summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-20 16:52:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-20 16:55:08 +0200
commit67a6dac7c18caecb418f7590a484dcbfcad869ab (patch)
treedfc518e76432ade673085eb8003c25edefb5fc53 /cmdutils.c
parentc5af0680848a62c482c0fd142f8d6646cec46212 (diff)
parent7c5012127fb7e18f0616011257bb4248f6a8b608 (diff)
Merge commit '7c5012127fb7e18f0616011257bb4248f6a8b608'
* commit '7c5012127fb7e18f0616011257bb4248f6a8b608': cmdutils: change semantics of show_help_options() and document it. avtools: move some newlines to show_help_options(). avconv: deprecate -isync. Conflicts: ffmpeg_opt.c ffserver.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/cmdutils.c b/cmdutils.c
index eeb5e39099..443873b779 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -141,8 +141,8 @@ int64_t parse_time_or_die(const char *context, const char *timestr,
return us;
}
-void show_help_options(const OptionDef *options, const char *msg, int mask,
- int value)
+void show_help_options(const OptionDef *options, const char *msg, int req_flags,
+ int rej_flags)
{
const OptionDef *po;
int first;
@@ -150,19 +150,23 @@ void show_help_options(const OptionDef *options, const char *msg, int mask,
first = 1;
for (po = options; po->name != NULL; po++) {
char buf[64];
- if ((po->flags & mask) == value) {
- if (first) {
- printf("%s", msg);
- first = 0;
- }
- av_strlcpy(buf, po->name, sizeof(buf));
- if (po->flags & HAS_ARG) {
- av_strlcat(buf, " ", sizeof(buf));
- av_strlcat(buf, po->argname, sizeof(buf));
- }
- printf("-%-17s %s\n", buf, po->help);
+
+ if (((po->flags & req_flags) != req_flags) ||
+ (po->flags & rej_flags))
+ continue;
+
+ if (first) {
+ printf("%s\n", msg);
+ first = 0;
+ }
+ av_strlcpy(buf, po->name, sizeof(buf));
+ if (po->flags & HAS_ARG) {
+ av_strlcat(buf, " ", sizeof(buf));
+ av_strlcat(buf, po->argname, sizeof(buf));
}
+ printf("-%-17s %s\n", buf, po->help);
}
+ printf("\n");
}
void show_help_children(const AVClass *class, int flags)