akamensky / argparse

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

Add name to positional parameters #114

Closed tgoncuoglu closed 1 year ago

tgoncuoglu commented 1 year ago

When displaying Usage for positional arguments a generic --_positionalArg__1 name is generated, which does not convey what the argument is for, starts with -- (which is wrong), and overall does not look nice. Instead, I made some changes to display these arguments when a name is given, in the way pythons argparse does. When no name is given, it will still auto-generate that arg name.

This

StringPositional(&argparse.Options{Help: "Some URL Argument"})

was resulting in this:

--_positionalArg__1 Some Help Text

Instead, this StringPositional("URL", &argparse.Options{Help: "Some URL Argument"})

will display this: <URL> Some URL Argument

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. Thank you for your contributions. Feel free to comment or otherwise update to keep it alive.

stale[bot] commented 1 year ago

Closing due to old age. Feel free to re-open or ping maintainers.