Skip to content
Snippets Groups Projects
Commit 876c89a8 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

cmdline: Check options array for not working flag combinations

parent 107e4da4
No related branches found
No related tags found
No related merge requests found
...@@ -482,10 +482,22 @@ static void dump_argument(const char *a) ...@@ -482,10 +482,22 @@ static void dump_argument(const char *a)
fputc('"', report_file); fputc('"', report_file);
} }
static void check_options(const OptionDef *po)
{
while (po->name) {
if (po->flags & OPT_PERFILE)
av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
po++;
}
}
void parse_loglevel(int argc, char **argv, const OptionDef *options) void parse_loglevel(int argc, char **argv, const OptionDef *options)
{ {
int idx = locate_option(argc, argv, options, "loglevel"); int idx = locate_option(argc, argv, options, "loglevel");
const char *env; const char *env;
check_options(options);
if (!idx) if (!idx)
idx = locate_option(argc, argv, options, "v"); idx = locate_option(argc, argv, options, "v");
if (idx && argv[idx + 1]) if (idx && argv[idx + 1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment