small tweaks - make dry-run hidden

This commit is contained in:
Matt Jaffee 2017-03-16 11:53:09 -05:00
parent 06b90782af
commit a1d29537db
3 changed files with 4 additions and 3 deletions

View file

@ -54,6 +54,7 @@ Build Time: ` + BuildTime + "\n",
},
}
rc.PersistentFlags().Bool("dry-run", false, "stop before executing")
rc.PersistentFlags().MarkHidden("dry-run")
rc.PersistentFlags().StringP("config", "c", "", "Configuration file to read from.")
for _, subcomFn := range subcommandFns {
rc.AddCommand(subcomFn(stdin, stdout, stderr))

View file

@ -80,7 +80,7 @@ type commandTest struct {
validation func() error
}
func (ct commandTest) setupCommand(t *testing.T) *cobra.Command {
func (ct *commandTest) setupCommand(t *testing.T) *cobra.Command {
// make config file
cfgFile, err := ioutil.TempFile("", "")
failErr(t, err, "making temp file")
@ -106,7 +106,7 @@ func (ct commandTest) setupCommand(t *testing.T) *cobra.Command {
return rc
}
func (ct commandTest) reset() {
func (ct *commandTest) reset() {
for name, _ := range ct.env {
os.Setenv(name, "")
}

View file

@ -75,7 +75,7 @@ on the configured port.`,
flags := serveCmd.Flags()
flags.StringVarP(&Server.Config.DataDir, "data-dir", "d", "~/.pilosa", "Directory to store pilosa data files.")
flags.StringVarP(&Server.Config.Host, "bind", "", ":10101", "Default URI on which pilosa should listen.")
flags.StringVarP(&Server.Config.Host, "bind", "b", ":10101", "Default URI on which pilosa should listen.")
flags.IntVarP(&Server.Config.Cluster.ReplicaN, "cluster.replicas", "", 1, "Number hosts each piece of data should be stored on.")
flags.StringSliceVarP(&Server.Config.Cluster.Nodes, "cluster.hosts", "", []string{}, "Comma separated list of hosts in cluster.")
flags.DurationVarP((*time.Duration)(&Server.Config.Cluster.PollingInterval), "cluster.poll-interval", "", time.Minute, "Polling interval for cluster.") // TODO what actually is this?