Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,15 @@ func parse(doc string, argv []string, help bool, version string, optionsFirst bo
return
}

err = newUserError("")
if len(*left) > 0 {
var left_names []string
for _, l := range(*left) {
left_names = append(left_names, l.name)
}
err = newUserError(fmt.Sprintf("Unknown option(s): %s", strings.Join(left_names, ", ")))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caldwell - I believe golint will complain about this error message because the first letter is capitalized.
https://github.com/golang/go/wiki/CodeReviewComments#error-strings

} else {
err = newUserError("")
}
output = handleError(err, usage)
return
}
Expand Down