akamensky / argparse

Argparse for golang. Just because `flag` sucks
MIT License
611 stars 62 forks source link

Usage(err interface{}) only uses values of type error #24

Closed aefalcon closed 5 years ago

aefalcon commented 6 years ago

Regarding func (*Command) Usage(err interface{}) string, only values of err with types subCommandError and error are used by the function. Because subCommandError is an implementation of error, the argument should really be of type error.

It would be nice if it also accounted for string and fmt.Stringer, but I think documentation should at least note what the supported types are.

akamensky commented 6 years ago

I agree it should accept strings and related types.

I may be able to look at this later.