You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app needs to do some pre-processing before letting command handlers run, e.g. if --debug I wait for debugger to attach even before creating the root command.
I am trying to use RootCommand.Parse() to get the parsed results, then look and see what root options were set, e.g. --debug, handle those, and then call ParseResult.Invoke().
I found that if I call RootCommand.Invoke() then --help and --version is handled as expected.
but when I call RootCommand.Parse(), --help or --version are reported as errors, and consequently ParseResult.Invoke() does not handle help or version.
Is this really expected, if halp and version is hardwired in (still waiting for elegant way to override version reporting), should they not be handled by RootCommand.Parse() and by ParseResult.Invoke()?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My app needs to do some pre-processing before letting command handlers run, e.g. if
--debug
I wait for debugger to attach even before creating the root command.I am trying to use
RootCommand.Parse()
to get the parsed results, then look and see what root options were set, e.g.--debug
, handle those, and then callParseResult.Invoke()
.I found that if I call
RootCommand.Invoke()
then--help
and--version
is handled as expected.but when I call
RootCommand.Parse()
,--help
or--version
are reported as errors, and consequentlyParseResult.Invoke()
does not handle help or version.Is this really expected, if halp and version is hardwired in (still waiting for elegant way to override version reporting), should they not be handled by
RootCommand.Parse()
and byParseResult.Invoke()
?Beta Was this translation helpful? Give feedback.
All reactions