JMS #4: More WIP

This commit is contained in:
Jeremy Saenz 2013-07-17 17:22:30 -07:00
parent 3b0fc03a67
commit 04496e4364
2 changed files with 6 additions and 2 deletions

6
cli.go
View File

@ -22,7 +22,11 @@ var Action = ShowHelp
func Run(args []string) {
set := flagSet(Flags)
set.Parse(args[1:])
err := set.Parse(args[1:])
if err != nil {
println(err)
return
}
context := NewContext(set)
if len(args) > 1 {

View File

@ -36,7 +36,7 @@ func (f BoolFlag) Apply(set *flag.FlagSet) {
}
func flagSet(flags []Flag) *flag.FlagSet {
set := flag.NewFlagSet("set", flag.PanicOnError)
set := flag.NewFlagSet(Name, 0)
for _, f := range flags {
f.Apply(set)
}