Skip to content

Commit d118937

Browse files
authored
metaflac: print error if no operations (#876)
This solves the issue of giving no indication if the wrong command line was used. Fixes #861
1 parent afb801b commit d118937

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/metaflac/options.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options)
216216
}
217217
}
218218

219+
if(!options->show_long_help && !options->show_version &&
220+
(options->args.checks.num_major_ops == 0) && (options->args.checks.num_shorthand_ops == 0)) {
221+
flac_fprintf(stderr, "ERROR: no operations specified\n");
222+
had_error = true;
223+
}
224+
219225
/* check for only one FLAC file used with certain options */
220226
if(!had_error && options->num_files > 1) {
221227
if(0 != options->output_name) {

0 commit comments

Comments
 (0)