Replies: 5 comments
-
I can't recall exactly, but if it's possible it would be in one of the help options or alternate formatters. Check them out. |
Beta Was this translation helpful? Give feedback.
-
I am also curious about this. |
Beta Was this translation helpful? Give feedback.
-
FWIW the Kong behaviour is often called "interspersed" flags and arguments, so if this were made into an option it would be something like |
Beta Was this translation helpful? Give feedback.
-
I would personally like something in the middle: that parsing succeeds for interspersed flags, but that help does not mention those flags from higher levels. |
Beta Was this translation helpful? Give feedback.
-
Just for reference, I was able to workaround my issue by making |
Beta Was this translation helpful? Give feedback.
-
Consider the following structure of my app
foo
:(Demo: https://play.golang.org/p/SldnjrkVsxd)
If I run
foo subcommand -h
to print the help for my subcommand, it also includes the--version
flag from the parent in the help output. In this case, I don’t want that, though, but I only want--version
to be available and displayed on the base command.Is there a way to achieve this?
The only way I could find is marking the
Version
flag ashidden:"1"
. That’s a bit hacky, however, because a) it’s still processed, and b) it doesn’t show up in the base help output anymore.Beta Was this translation helpful? Give feedback.
All reactions