[GH-ISSUE #28] handle global Flags #11

Open
opened 2026-02-16 12:57:47 -05:00 by yindo · 3 comments
Owner

Originally created by @root360-AndreasUlm on GitHub (May 2, 2019).
Original GitHub issue: https://github.com/go-gitea/tea/issues/28

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:

Originally created by @root360-AndreasUlm on GitHub (May 2, 2019). Original GitHub issue: https://github.com/go-gitea/tea/issues/28 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
Author
Owner

@root360-AndreasUlm commented on GitHub (May 2, 2019):

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 commented on GitHub (May 2, 2019): 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.
Author
Owner

@lunny commented on GitHub (May 2, 2019):

@root360-AndreasUlm I think #26 is easier for review.

@lunny commented on GitHub (May 2, 2019): @root360-AndreasUlm I think #26 is easier for review.
Author
Owner

@root360-AndreasUlm commented on GitHub (May 2, 2019):

@lunny then let's go with #26.
I'll close #15 and #27.

@root360-AndreasUlm commented on GitHub (May 2, 2019): @lunny then let's go with #26. I'll close #15 and #27.
yindo changed title from handle global Flags to [GH-ISSUE #28] handle global Flags 2026-06-05 16:34:06 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: go-gitea/tea#11