Merge pull request #63 from AnthonyLam/issue-49

Add -V and -h for flag parsing
This commit is contained in:
J Guerreiro 2017-11-12 10:48:27 +09:00 committed by GitHub
commit 878c606556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
cmd.go
View File

@ -142,10 +142,14 @@ func parser() (op string, options []string, packages []string, changedConfig boo
}
if arg[0] == '-' && arg[1] != '-' {
switch arg {
case "-V":
arg = "--version"
case "-h":
arg = "--help"
default:
op = arg
continue
}
continue
}
if arg[0] == '-' && arg[1] == '-' {