Replies: 1 comment
-
@abdennour Cant you use a Before func for the command to do the Global Initialization for all the subcommands. The App/Command/Subcommand all have Before funcs, so you can do multi level initialization depending on your needs |
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
-
Checklist
What problem does this solve?
Sometimes, Global flag ( used by all subocommands) requires dynamic initialization. Thus, literal default values, values from env vars, values from file content or even values from alt src will not work.
If this dynamic initialization does not done in a one place, it will lead to repeating ourselves then not complying with DRY.
Solution description
Describe alternatives you've considered
For now, i am just repeating myself everywhere
Beta Was this translation helpful? Give feedback.
All reactions