Skip to content

fix: Tells the user to specify a version

John Skarbek requested to merge jts/upgrade-doc into main

What

  • Specifying the version is required for the upgrade command
  • This ensures the help spits out that little tidbit of information
  • Otherwise, users do not know if a flag could be the culprit of a poorly constructed command

Before

% ./ringctl upgrade -e test --ring 0 --dry-run
Error: accepts 1 arg(s), received 0
Usage:
  ringctl upgrade [flags]

Flags:
  -h, --help   help for upgrade

Global Flags:
  -e, --amp_environment string   the amp cluster to target (default is test) (default "test")
  -b, --branch string            the branch to use (default is main) (default "main")
      --config string            config file (default is ringctl.yaml)
  -n, --dry-run                  dry run mode (default is false)
      --ring uint                the ring where the cell is located

I've got arguments to all of the necessary flags, so I'm not sure what I'm missing.

After

% ./ringctl upgrade -e test --ring 0 --dry-run
Error: accepts 1 arg(s), received 0
Usage:
  ringctl upgrade <version> [flags]

Flags:
  -h, --help   help for upgrade

Global Flags:
  -e, --amp_environment string   the amp cluster to target (default is test) (default "test")
  -b, --branch string            the branch to use (default is main) (default "main")
      --config string            config file (default is ringctl.yaml)
  -n, --dry-run                  dry run mode (default is false)
      --ring uint                the ring where the cell is located

Aside from the error still showcasing, at least the Usage now instructs the user the requirement of the version

Why

DevUX!

Merge request reports