-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Hello,
I need to distinguish in my code which options comes from the user (via CLI options), and which one are just the default values.
For that, I use getOptionValueSource()
but I have an issue with that, as it always return undefined when trying to get the source of a global option in a command context.
I retrieve all options using command.optsWithGlobals()
, but then command.getOptionValueSource()
only works for command-level options, and if I use program.getOptionValueSource()
it only works with global-level options.
Should I merge all options manually instead of using optsWithGlobals()
to separate the two contexts when trying to determine the source of the options? It would seems a bit complicated for a simple use case.
Would you consider adding a getOptionValueSourceWithGlobals
to match the behavior of optsWithGlobals
, so that we could retrieve the option's source if it comes either from command or global level?