Skip to content

Commit

Permalink
start-single-node: hide more flags from --help
Browse files Browse the repository at this point in the history
Release justification: no impact on functionality, needed for product polish

The new command `cockroach start-single-node`, as its name implies, is
intended for use by beginners / developers running single-node
clusters. It is thus important not to overwhelm them with details that
are not directly relevant when they explore the program with
e.g. `--help`.

To enhance their experience, this patch hides a few more parameters
from `start-single-node --help`:

`--max-offset`
`--locality-advertise-addr`
`--advertise-addr`
`--advertise-sql-addr`

Release note: None
  • Loading branch information
knz committed Sep 19, 2019
1 parent 0568c63 commit 7989001
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,19 @@ func init() {
VarFlag(f, &serverCfg.JoinList, cliflags.Join)
VarFlag(f, clusterNameSetter{&baseCfg.ClusterName}, cliflags.ClusterName)
BoolFlag(f, &baseCfg.DisableClusterNameVerification, cliflags.DisableClusterNameVerification, false)
// We also hide it from help for 'start-single-node'.
if cmd == startSingleNodeCmd {
// Even though all server flags are supported for
// 'start-single-node', we intend that command to be used by
// beginners / developers running on a single machine. To
// enhance the UX, we hide the flags since they are not directly
// relevant when running a single node.
_ = f.MarkHidden(cliflags.Join.Name)
_ = f.MarkHidden(cliflags.ClusterName.Name)
_ = f.MarkHidden(cliflags.DisableClusterNameVerification.Name)
_ = f.MarkHidden(cliflags.MaxOffset.Name)
_ = f.MarkHidden(cliflags.LocalityAdvertiseAddr.Name)
_ = f.MarkHidden(cliflags.AdvertiseAddr.Name)
_ = f.MarkHidden(cliflags.SQLAdvertiseAddr.Name)
}

// Engine flags.
Expand Down

0 comments on commit 7989001

Please sign in to comment.