Bug #11863

[Go] CLI programs should exit 0 after giving -help

Added by Tom Clegg over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
Start date:
06/16/2017
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

Currently "prog -help" relies on the "print usage and exit non-zero if given flag is undefined" behavior in the stdlib "flag" package.

To fix this, we can set ErrorHandling to ContinueOnError, and check the return value of Parse():
  • if flag.ErrHelp, os.Exit(0)
  • if other non-nil error, os.Exit(2)

History

#1 Updated by Tom Morris over 1 year ago

  • Target version set to Arvados Future Sprints

Also available in: Atom PDF