Skip to content

Commit

Permalink
fix: Cobra flags get merged at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhfr committed Sep 13, 2022
1 parent e539004 commit 85b179a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func getInput(cmd *cobra.Command) game.Input {

// getOptions returns the options from the root command persistent flags
func getOptions(cmd *cobra.Command) options {
broadcast, _ := cmd.PersistentFlags().GetBool(broadcast)
noPGN, _ := cmd.PersistentFlags().GetBool(noPGN)
port, _ := cmd.PersistentFlags().GetInt(port)
broadcast, _ := cmd.Flags().GetBool(broadcast)
noPGN, _ := cmd.Flags().GetBool(noPGN)
port, _ := cmd.Flags().GetInt(port)

return options{
broadcast: broadcast,
Expand Down

0 comments on commit 85b179a

Please sign in to comment.