Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVEREST-1778 Extend help message for CLI namespace add command #992

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
10 changes: 3 additions & 7 deletions commands/namespaces/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ var (
// NewAddCommand returns a new command to add a new namespace.
func NewAddCommand(l *zap.SugaredLogger) *cobra.Command {
cmd := &cobra.Command{
Use: "add",
Use: "add [flags] NAMESPACES",
Long: "Add a new namespace",
Short: "Add a new namespace",
Example: `everestctl namespaces add [NAMESPACE] [FLAGS]`,
Example: `everestctl namespaces add --operator.mongodb=true --operator.postgresql=false --operator.xtradb-cluster=false --skip-wizard ns-1,ns-2`,
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
initAddViperFlags(cmd)
c := &namespaces.NamespaceAddConfig{}
Expand All @@ -39,12 +40,7 @@ func NewAddCommand(l *zap.SugaredLogger) *cobra.Command {
}
bindInstallHelmOpts(c)

if len(args) != 1 {
output.PrintError(fmt.Errorf("invalid number of arguments: expected 1, got %d", len(args)), l, true)
os.Exit(1)
}
c.Namespaces = args[0]

enableLogging := viper.GetBool("verbose") || viper.GetBool("json")
c.Pretty = !enableLogging

Expand Down
Loading