tea
tea copied to clipboard
handle global Flags
While trying to solve #12 with PR #15 several options were discussed. To move the discussion out of the PR and summarize the available options I create this issue.
The short summary of the problem #12 pointed out is that the current CLI lib does not inherit global flags into several subcommands (see https://github.com/urfave/cli/issues/585)
The currently available options are:
- switching to Cobra a different CLI lib (suggested by @noerw )
- creating global flags and use append() to merge subcommand flags with global flags (suggested by @techknowlogick )
To compare both options I created a branch in my fork for each of them:
- Cobra: #27
- current cli: #26
After implementing #26 I found this solution to be easier and the workaround seems to work quite well. The switch to Cobra will take more time.
@root360-AndreasUlm I think #26 is easier for review.
@lunny then let's go with #26. I'll close #15 and #27.