From: Anton Khirnov <anton@khirnov.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/8] fftools/cmdutils: drop alt_flags parameter from show_help_options()
Date: Wed, 17 Jan 2024 13:40:30 +0100
Message-ID: <20240117124036.7877-3-anton@khirnov.net> (raw)
In-Reply-To: <20240117124036.7877-1-anton@khirnov.net>
No user sets it to more than one flag, so it is redundant with
req_flags.
---
fftools/cmdutils.c | 3 +--
fftools/cmdutils.h | 3 +--
fftools/ffmpeg_opt.c | 28 ++++++++++++++--------------
fftools/ffplay.c | 4 ++--
fftools/ffprobe.c | 2 +-
5 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index d7d5ddee45..be01372743 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -108,7 +108,7 @@ int parse_number(const char *context, const char *numstr, enum OptionType type,
}
void show_help_options(const OptionDef *options, const char *msg, int req_flags,
- int rej_flags, int alt_flags)
+ int rej_flags)
{
const OptionDef *po;
int first;
@@ -118,7 +118,6 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
char buf[128];
if (((po->flags & req_flags) != req_flags) ||
- (alt_flags && !(po->flags & alt_flags)) ||
(po->flags & rej_flags))
continue;
diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h
index 0c3b475876..69e253c6ef 100644
--- a/fftools/cmdutils.h
+++ b/fftools/cmdutils.h
@@ -200,10 +200,9 @@ typedef struct OptionDef {
* @param msg title of this group. Only printed if at least one option matches.
* @param req_flags print only options which have all those flags set.
* @param rej_flags don't print options which have any of those flags set.
- * @param alt_flags print only options that have at least one of those flags set
*/
void show_help_options(const OptionDef *options, const char *msg, int req_flags,
- int rej_flags, int alt_flags);
+ int rej_flags);
/**
* Show help for all options with given flags in class and all its
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 4a0d126aca..919e1eae46 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1197,46 +1197,46 @@ void show_help_default(const char *opt, const char *arg)
"\n", program_name);
show_help_options(options, "Print help / information / capabilities:",
- OPT_EXIT, OPT_EXPERT, 0);
+ OPT_EXIT, OPT_EXPERT);
if (show_advanced)
show_help_options(options, "Advanced information / capabilities:",
- OPT_EXIT | OPT_EXPERT, 0, 0);
+ OPT_EXIT | OPT_EXPERT, 0);
show_help_options(options, "Global options (affect whole program "
"instead of just one file):",
- 0, OPT_PERFILE | OPT_EXIT | OPT_EXPERT, 0);
+ 0, OPT_PERFILE | OPT_EXIT | OPT_EXPERT);
if (show_advanced)
show_help_options(options, "Advanced global options:", OPT_EXPERT,
- OPT_PERFILE | OPT_EXIT, 0);
+ OPT_PERFILE | OPT_EXIT);
- show_help_options(options, "Per-file main options:", 0,
+ show_help_options(options, "Per-file main options:", OPT_PERFILE,
OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA |
- OPT_EXIT, OPT_PERFILE);
+ OPT_EXIT);
if (show_advanced)
show_help_options(options, "Advanced per-file options:",
- OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE, OPT_PERFILE);
+ OPT_EXPERT | OPT_PERFILE, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE);
show_help_options(options, "Video options:",
- OPT_VIDEO, OPT_EXPERT | OPT_AUDIO | OPT_SUBTITLE | OPT_DATA, 0);
+ OPT_VIDEO, OPT_EXPERT | OPT_AUDIO | OPT_SUBTITLE | OPT_DATA);
if (show_advanced)
show_help_options(options, "Advanced Video options:",
- OPT_EXPERT | OPT_VIDEO, OPT_AUDIO | OPT_SUBTITLE | OPT_DATA, 0);
+ OPT_EXPERT | OPT_VIDEO, OPT_AUDIO | OPT_SUBTITLE | OPT_DATA);
show_help_options(options, "Audio options:",
- OPT_AUDIO, OPT_EXPERT | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA, 0);
+ OPT_AUDIO, OPT_EXPERT | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA);
if (show_advanced)
show_help_options(options, "Advanced Audio options:",
- OPT_EXPERT | OPT_AUDIO, OPT_VIDEO | OPT_SUBTITLE | OPT_DATA, 0);
+ OPT_EXPERT | OPT_AUDIO, OPT_VIDEO | OPT_SUBTITLE | OPT_DATA);
show_help_options(options, "Subtitle options:",
- OPT_SUBTITLE, OPT_EXPERT | OPT_VIDEO | OPT_AUDIO | OPT_DATA, 0);
+ OPT_SUBTITLE, OPT_EXPERT | OPT_VIDEO | OPT_AUDIO | OPT_DATA);
if (show_advanced)
show_help_options(options, "Advanced Subtitle options:",
- OPT_EXPERT | OPT_SUBTITLE, OPT_VIDEO | OPT_AUDIO | OPT_DATA, 0);
+ OPT_EXPERT | OPT_SUBTITLE, OPT_VIDEO | OPT_AUDIO | OPT_DATA);
if (show_advanced)
show_help_options(options, "Data stream options:",
- OPT_DATA, OPT_VIDEO | OPT_AUDIO | OPT_SUBTITLE, 0);
+ OPT_DATA, OPT_VIDEO | OPT_AUDIO | OPT_SUBTITLE);
printf("\n");
if (show_avoptions) {
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index e0f6db46bc..61edf2c2ef 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3705,8 +3705,8 @@ void show_help_default(const char *opt, const char *arg)
{
av_log_set_callback(log_callback_help);
show_usage();
- show_help_options(options, "Main options:", 0, OPT_EXPERT, 0);
- show_help_options(options, "Advanced options:", OPT_EXPERT, 0, 0);
+ show_help_options(options, "Main options:", 0, OPT_EXPERT);
+ show_help_options(options, "Advanced options:", OPT_EXPERT, 0);
printf("\n");
show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);
show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index ea1365688d..f33e2471cb 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3869,7 +3869,7 @@ void show_help_default(const char *opt, const char *arg)
{
av_log_set_callback(log_callback_help);
show_usage();
- show_help_options(options, "Main options:", 0, 0, 0);
+ show_help_options(options, "Main options:", 0, 0);
printf("\n");
show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
--
2.42.0
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-01-17 12:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 12:40 [FFmpeg-devel] [PATCH 1/8] fftools/cmdutils: hide some information listing options from basic help Anton Khirnov
2024-01-17 12:40 ` [FFmpeg-devel] [PATCH 2/8] fftools/cmdutils: add a flag for per-stream options Anton Khirnov
2024-01-17 13:01 ` Michael Niedermayer
2024-01-17 14:57 ` Anton Khirnov
2024-01-17 12:40 ` Anton Khirnov [this message]
2024-01-17 12:40 ` [FFmpeg-devel] [PATCH 4/8] fftools/ffmpeg_opt: add more structure to long help output Anton Khirnov
2024-01-17 12:40 ` [FFmpeg-devel] [PATCH 5/8] fftools/cmdutils: indicate specifiers in option syntax in " Anton Khirnov
2024-01-17 12:40 ` [FFmpeg-devel] [PATCH 6/8] fftools/ffmpeg_opt: briefly mention stream specifier " Anton Khirnov
2024-01-17 12:40 ` [FFmpeg-devel] [PATCH 7/8] fftools/cmdutils: surround option arguments by <> " Anton Khirnov
2024-01-17 12:40 ` [FFmpeg-devel] [PATCH 8/8] fftools/ffmpeg_opt: improve wording in option descriptions Anton Khirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240117124036.7877-3-anton@khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git