[FFmpeg-cvslog] r20822 - in trunk: ffmpeg.c ffplay.c

Stefano Sabatini stefano.sabatini-lala
Sun Dec 13 16:15:16 CET 2009


On date Sunday 2009-12-13 14:49:14 +0100, michael wrote:
> Author: michael
> Date: Sun Dec 13 14:49:14 2009
> New Revision: 20822
> 
> Log:
> Show help if no cmd line options are provided at all.
> This safes the users time to find out which of -h --help -? works.

I consider this a bad UI policy, a program should show help only when
it is explicitely requested to do so, that's generating a lot of
output when the only message displayed should be: "ehy you need to
specify a file".

And BTW, yes the user is supposed to read the man page at some point,
at least to see how to ask for help.

Also no-one is preventing us to create an alias for "-h".

> Modified:
>    trunk/ffmpeg.c
>    trunk/ffplay.c
> 
> Modified: trunk/ffmpeg.c
> ==============================================================================
> --- trunk/ffmpeg.c	Sun Dec 13 11:07:08 2009	(r20821)
> +++ trunk/ffmpeg.c	Sun Dec 13 14:49:14 2009	(r20822)
> @@ -3985,6 +3985,9 @@ int main(int argc, char **argv)
>      /* parse options */
>      parse_options(argc, argv, options, opt_output_file);
>  
> +    if(nb_output_files <= 0 && nb_input_files == 0)
> +        show_help();

This is especially disturbing in the case:
ffmpeg in.avi ... out.avi #yes I perfectly know the syntax but I forgot to add an -i
[lot of unsolicited help]
At least one input file must be specified

>      /* file converter / grab */
>      if (nb_output_files <= 0) {
>          fprintf(stderr, "At least one output file must be specified\n");
> 
> Modified: trunk/ffplay.c
> ==============================================================================
> --- trunk/ffplay.c	Sun Dec 13 11:07:08 2009	(r20821)
> +++ trunk/ffplay.c	Sun Dec 13 14:49:14 2009	(r20822)
> @@ -2539,6 +2539,7 @@ int main(int argc, char **argv)
>      parse_options(argc, argv, options, opt_input_file);
>  
>      if (!input_filename) {
> +        show_help();
>          fprintf(stderr, "An input file must be specified\n");
>          exit(1);
>      }

I suggest to revert this and eventually add some warning of the kind:
"At least one input file must be specified. Use -h for showing the
inline help message."

Regards.



More information about the ffmpeg-cvslog mailing list