dudebing99 / flag

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's the differences from official flag

  • add SkipOnError strategy, which just skip and continue to parse next flags, neither exit nor panic.
const (
	ContinueOnError ErrorHandling = iota // Return a descriptive error.
	SkipOnError                          // Skip and continue
	ExitOnError                          // Call os.Exit(2) or for -h/-help Exit(0).
	PanicOnError                         // Call panic with a descriptive error.
)
  • Enable SkipOnError strategy by default.
var CommandLine = NewFlagSet(os.Args[0], SkipOnError)

About

License:MIT License


Languages

Language:Go 100.0%