[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    Re: [patch] correct file(1) printed usage
From:       Jason McIntyre <jmc () kerhand ! co ! uk>
Date:       2015-05-28 19:27:27
Message-ID: 20150528192752.GB18066 () harkle ! home ! gateway
[Download RAW message or body]

On Thu, May 28, 2015 at 07:37:52PM +0200, S??bastien Marie wrote:
> Hi,
> 
> I would report (and correct) an invalid usage statement of file(1).
> 
> $ file
> usage: file [-bchiLsW] [file ...]
> 
> $ man file | grep -A1 'SY'
> SYNOPSIS
>      file [-bchiLsW] file ...
> 
> As at least one argument is mandatory, removing the [] would make sens.
> 
> Thanks.
> -- 
> S??bastien Marie
> 

not exactly..."file -c" works, for example. but i think it makes most
sense to show it as being required, and this way at least the doc/usage
are in sync.

so, fixed now.
jmc

> 
> Index: file.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/file/file.c,v
> retrieving revision 1.32
> diff -u -p -r1.32 file.c
> --- file.c	24 Apr 2015 17:34:57 -0000	1.32
> +++ file.c	28 May 2015 17:30:09 -0000
> @@ -85,7 +85,7 @@ static struct option longopts[] = {
>  __dead void
>  usage(void)
>  {
> -	fprintf(stderr, "usage: %s [-bchiLsW] [file ...]\n", __progname);
> +	fprintf(stderr, "usage: %s [-bchiLsW] file ...\n", __progname);
>  	exit(1);
>  }
>  
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic