Deduplicating flag definitions #2924
Answered
by
rsteube
kaathewisegit
asked this question in
Q&A
-
|
I have a case where two commands have a lot of flags, majority of which are the same. What's the best way to go about deduplicating them? I could copy-paste, but that would make updating them error-prone |
Beta Was this translation helpful? Give feedback.
Answered by
rsteube
Aug 17, 2025
Replies: 1 comment 1 reply
-
|
I tend to add a util function that accepts |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kaathewisegit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tend to add a util function that accepts
*cobra.Commandin a*_completer/cmd/commonsubfolder:https://github.com/carapace-sh/carapace-bin/blob/45a7bb511f7e0aebe3fe906634d1b7850fdefb55/completers/common/git_completer/cmd/common/diff.go