Execute `runFlagActions` before `c.Before`
axelrindle opened this issue · 3 comments
axelrindle commented
I have a flag named config
which specifies the path to an alternative config file to use.
I do the config loading in the c.Before
hook.
However I noticed that the flag actions are run after the c.Before
hook.
Lines 216 to 227 in d391482
How can I achieve the flag action being run before the c.Before
hook?
dearchap commented
@axelrindle As of now it is not possible. There has been some discussion on lifecycle hooks for v3. See #1273 . If you have suggestions of how you'd like to improve this behavior it would be great.
axelrindle commented
The concept of lifecycle hooks sounds great to me. I'd like to propose the following:
beforeFlags
(runs before flags are parsed)afterFlags
(runs after flags are parsed, but before commands are run)beforeCommand
(runs before command actions are run; maybe merge with the previous?)afterCommand
(runs after a command action has been run)
dearchap commented
@axelrindle I'm going to move this conversation to #1273 and close this issue