From 04496e4364fb395ccfe2fa0fa3f61a4a8e694e5f Mon Sep 17 00:00:00 2001 From: Jeremy Saenz Date: Wed, 17 Jul 2013 17:22:30 -0700 Subject: [PATCH] JMS #4: More WIP --- cli.go | 6 +++++- flag.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cli.go b/cli.go index a5ae417..e925872 100644 --- a/cli.go +++ b/cli.go @@ -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 { diff --git a/flag.go b/flag.go index aabb86c..28430a6 100644 --- a/flag.go +++ b/flag.go @@ -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) }