Opened 13 years ago
Closed 12 years ago
#637 closed enhancement (fixed)
Always detect `--help` option
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | major | Milestone: | yat 0.8 |
Component: | utility | Version: | trunk |
Keywords: | Cc: |
Description
From http://dev.thep.lu.se/svndigest/ticket/471
First a few example command lines. --anchor_format
does not exist, I simply made a guess.
svndigest --anchor_format=null svndigest --anchor_format=null --help svndigest --help --anchor_format=null
Obviously the first line above fails but so do the second line. The third line will go through and help information is displayed. I think the second line should also be accepted and help information should be displayed. If I get an invalid argument message I usually add --help
to my command line without change anything else. I read the help and correct my mistake.
Change option parsing to accept --help
irrespective order and invalid arguments.
Change History (7)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
The tread has continued in bug-standards @
http://lists.gnu.org/archive/html/bug-standards/2010-11/msg00007.html
comment:3 follow-up: 4 Changed 13 years ago by
Is the idea here to wait for a decision in bug-standards and the go for their conclusion?
comment:4 Changed 13 years ago by
Replying to jari:
Is the idea here to wait for a decision in bug-standards and the go for their conclusion?
Not really. I figured the different opinions were relevant for this ticket. If there were a decision that this behaviour is required then I would feel more motivated to get this done before next minor release. I don't think there will be a decision, but GCS is unspecific here.
comment:5 Changed 12 years ago by
Milestone: | yat 0.x+ → yat 0.8 |
---|---|
Owner: | changed from Jari Häkkinen to Peter |
Status: | new → assigned |
comment:7 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [2458]) Always detect '--help' (fixes #637). Change CommandLine::parse so the entire commandline is parsed. When an error is detected it is stored and _after_ commandline has been parsed, the exception is thrown. New tests 'help.test' and 'help_test.sh'; latter calls former with '--help' and invalid arguments to check that '--help' is always detected. Added a function 'run' in 'common_defs.sh.in'. Remove test case from commandline.cc because OptionHelp? calls exit and the remaining tests (in commandline) were not run.
This GNU Automake thread discusses this and they seem to think it is a bad idea because it just makes the code more complicated.