akamensky / argparse

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

Fix Issue 59 #60

Closed thegreyd closed 4 years ago

thegreyd commented 4 years ago

Fix for Repeated Text in subcommand usage text. The bug was introduced in https://github.com/akamensky/argparse/commit/112b813b83328a106c169377866b5c7c9d308eca where Usage method functionality was extracted into separate functions. Previously when a subcommand error was found, Usage was called recursively and the result string was returned. After being extracted to a unction that case was not being handled. I simply added a boolean flag to indicate that. Added a basic test to verify usage would not repeat.

akamensky commented 4 years ago

@thegreyd Thanks, LGTM!