Replies: 2 comments
-
The Context should contain all of the flags and commands IIRC |
Beta Was this translation helpful? Give feedback.
0 replies
-
The Context should contain all of the flags and commands IIRC |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a somewhat special use-case and was wondering whether or how I can make that happen with kong.
For my CLI app, users should be able to specify multiple instances of flags
--foo
and--bar
. What’s special is that the overall order of these flags is significant.In the following example, the app is invoked with the same flags and values, but they are given in a different order. I want to handle both cases slightly differently in my application.
Is there a way to determine the overall order of the flags with kong? Of course, I could re-parse the flags via
os.Args
, but then I’d have to manually account for all invariants such as--foo=1
,-f 1
, aliases, etc.I have already looked through the code and I think something like the scanned flag tokens could be an option to solve this, but there is currently no way to get a handle on them. But there also might be a better way to achieve this.
Beta Was this translation helpful? Give feedback.
All reactions