Closed skaymakca closed 4 years ago
Looks like a bug introduced by recent changes
@densestvoid you did some changes recently related to Usage output, do you think this is related? I verified this using examples/commands-advanced
example code.
same bug happened to me
when no args were given, the root and the sub both print help info twice
@akamensky Hello, I was looking at the library earlier and had some time to sit and take a look at the issue. The fix looked easy enough so I submitted a PR here https://github.com/akamensky/argparse/pull/60
@skaymakca or @naughtyGitCat can either of you please verify the issue is resolved in latest tip 936811b? (not released to go mod yet)
@skaymakca or @naughtyGitCat can either of you please verify the issue is resolved in latest tip 936811b? (not released to go mod yet)
the commands-advanced test seems correct, but I don't know how to test in my go.mod managed project
I wasn't able to test commands-advanced but I was able to test the commit in my internal project and the output looks correct now.
@naughtyGitCat I was able to test by running (in my go.mod project):
go get github.com/akamensky/argparse@936811b12db25dad4b7b86cbfd1dcc61571145cc
I wasn't able to test commands-advanced but I was able to test the commit in my internal project and the output looks correct now.
@naughtyGitCat I was able to test by running (in my go.mod project):
go get github.com/akamensky/argparse@936811b12db25dad4b7b86cbfd1dcc61571145cc
It fixed the problem, thanks
go get github.com/akamensky/argparse@936811b12db25dad4b7b86cbfd1dcc61571145cc
It fixed the problem, thanks
I see the fix was merged into master. Thanks everyone!
It has been released in v1.2.1 for go.mod projects
Thank you for the great library! As a former python argparse user this has helped getting a CLI together for some go work.
Working on a program with two levels of sub-commands I noticed the help info repeats with incorrect/incomplete argument usage. This is the not the case with doing -h on the sub-command.
This does not seem to be the same issue as #5 but might be related?
The command-advanced in examples shows this same behavior:
Repeated:
OK: