Skip to content

Commit

Permalink
Fix flags problem in agent commands
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Nov 23, 2018
1 parent 29cd916 commit 07671af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmd/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ func newAgentCommand() *cobra.Command {
TraverseChildren: true,
}

cmd.Flags().StringVarP(&nodeName, "node", "", "", "Unique name for node. If not set, fallback to hostname")
cmd.Flags().StringVarP(&bindAddr, "bind", "", "", "Bind address for TCP/UDP gossip on (host:port)")
cmd.Flags().StringVarP(&advertiseAddr, "advertise", "", "", "Address to advertise to cluster")
cmd.Flags().StringSliceVarP(&startJoin, "join", "", []string{}, "Comma-delimited list of nodes ([host]:port), through which a cluster can be joined")
cmd.PersistentFlags().StringVarP(&nodeName, "node", "", "", "Unique name for node. If not set, fallback to hostname")
cmd.PersistentFlags().StringVarP(&bindAddr, "bind", "", "", "Bind address for TCP/UDP gossip on (host:port)")
cmd.PersistentFlags().StringVarP(&advertiseAddr, "advertise", "", "", "Address to advertise to cluster")
cmd.PersistentFlags().StringSliceVarP(&startJoin, "join", "", []string{}, "Comma-delimited list of nodes ([host]:port), through which a cluster can be joined")

cmd.MarkPersistentFlagRequired("node")
cmd.MarkPersistentFlagRequired("bind")
Expand Down
4 changes: 2 additions & 2 deletions cmd/agent_auditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func newAgentAuditorCommand(ctx *agentContext) *cobra.Command {
var qedEndpoints []string

cmd := &cobra.Command{
Use: "monitor",
Use: "auditor",
Short: "Start a QED auditor",
Long: `Start a QED auditor that reacts to snapshot batches
propagated by QED servers and periodically executes membership
Expand Down Expand Up @@ -55,7 +55,7 @@ func newAgentAuditorCommand(ctx *agentContext) *cobra.Command {
}

cmd.Flags().StringSliceVarP(&qedEndpoints, "endpoints", "", []string{}, "Comma-delimited list of QED servers ([host]:port), through which an auditor can make queries")
cmd.MarkPersistentFlagRequired("endpoints")
cmd.MarkFlagRequired("endpoints")

return cmd
}
2 changes: 1 addition & 1 deletion cmd/agent_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func newAgentMonitorCommand(ctx *agentContext) *cobra.Command {
}

cmd.Flags().StringSliceVarP(&qedEndpoints, "endpoints", "", []string{}, "Comma-delimited list of QED servers ([host]:port), through which a monitor can make queries")
cmd.MarkPersistentFlagRequired("endpoints")
cmd.MarkFlagRequired("endpoints")

return cmd
}

0 comments on commit 07671af

Please sign in to comment.