Skip to content

Commit

Permalink
Actually return argGroup parse errors :\
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Jul 21, 2014
1 parent 630a909 commit 179d4eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 179d4eb

Please sign in to comment.