Fix cmd help output when entering an invalid command-line flag
This commit is contained in:
parent
e0f05cbeea
commit
f1a33bab48
@ -19,17 +19,21 @@ var version_string string
|
|||||||
* Main method
|
* Main method
|
||||||
*/
|
*/
|
||||||
func main() {
|
func main() {
|
||||||
profile_dir := flag.String("profile", ".", "TODO USAGE")
|
profile_dir := flag.String("profile", ".", "")
|
||||||
flag.StringVar(profile_dir, "p", ".", "TODO USAGE")
|
flag.StringVar(profile_dir, "p", ".", "")
|
||||||
|
|
||||||
show_version_flag := flag.Bool("version", false, "???")
|
show_version_flag := flag.Bool("version", false, "")
|
||||||
flag.BoolVar(show_version_flag, "v", false, "???")
|
flag.BoolVar(show_version_flag, "v", false, "")
|
||||||
|
|
||||||
how_many := flag.Int("n", 50, "???")
|
how_many := flag.Int("n", 50, "")
|
||||||
flag.IntVar(how_many, "number", 50, "???")
|
flag.IntVar(how_many, "number", 50, "")
|
||||||
|
|
||||||
help := flag.Bool("help", false, "???")
|
help := flag.Bool("help", false, "")
|
||||||
flag.BoolVar(help, "h", false, "???")
|
flag.BoolVar(help, "h", false, "")
|
||||||
|
|
||||||
|
flag.Usage = func() {
|
||||||
|
die("", true, 1)
|
||||||
|
}
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user