bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33468: A bug with yes and --help


From: Bernhard Voelker
Subject: bug#33468: A bug with yes and --help
Date: Mon, 26 Nov 2018 09:24:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 11/24/18 7:45 PM, Paul Eggert wrote:
> Why is the situation different for 'yes' than for other commands? The GNU 
> coding 
> standards are clear that 'yes --help foo' should act like 'yes --help'.
> 
> https://www.gnu.org/prep/standards/html_node/_002d_002dhelp.html

Thanks for the link.  Indeed, 'yes' is not special in this regard - I just 
wanted
to get the discussion going about how the behavior should be.
And: there are special programs - from Padraig's list:

>>>>  cksum dd echo expr getlimits hostid hostname link logname nohup printf
>>>>  sleep test tsort unlink uptime users whoami yes

- dd has argument-style options,
- echo is special per se,
- expr does its own argument handling,
- getlimits is an internal program,
- nohup invokes another program.

I suggest the attached:
- defining a central 'emit_help_or_version_info' in 'system.h',
- with no change for echo, expr and getlimits,
- nohup: only scan until the 1st non-option,
- and scanning over all args for all other of the above programs.

E.g. for 'yes', all of the following successfully detecting
the --version option (and likewise for --help):

  $ src/yes       --version
  $ src/yes hello --version
  $ src/yes hello --version world
  $ src/yes       --version hello
  $ src/yes hello --v       hello -- a b

WDYT?

Have a nice day,
Berny

Attachment: 0001-all-detect-help-and-version-more-consistently-FIXME.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]