Project

General

Profile

Actions

Bug #11863

open

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

Added by Tom Clegg almost 7 years ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
Story points:
-
Release:
Release relationship:
Auto

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)
Actions #1

Updated by Tom Morris over 6 years ago

  • Target version set to Arvados Future Sprints
Actions #2

Updated by Peter Amstutz almost 3 years ago

  • Target version deleted (Arvados Future Sprints)
Actions #3

Updated by Peter Amstutz about 1 year ago

  • Release set to 60
Actions #4

Updated by Peter Amstutz 2 months ago

  • Target version set to Future
Actions

Also available in: Atom PDF