From 179d4eb08bc8b66fc39efa325e2e6ce982c0f047 Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Mon, 21 Jul 2014 14:46:19 +1000 Subject: [PATCH] Actually return argGroup parse errors :\ --- app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index d255731..693025f 100644 --- a/app.go +++ b/app.go @@ -81,6 +81,9 @@ func (a *Application) Parse(args []string) (command string, err error) { } tokens := Tokenize(args) tokens, command, err = a.parse(tokens) + if err != nil { + return "", err + } if len(tokens) == 1 { return "", fmt.Errorf("unexpected argument '%s'", tokens) @@ -164,7 +167,7 @@ func (a *Application) parse(tokens tokens) (tokens, string, error) { default: } } - return tokens, selected, nil + return tokens, selected, err } // Errorf prints an error message to w.