Files
devvm/testdata/script/root.txtar
T
w3cjandClaude Opus 5.5 6dd2bd730f feat(cli): version, help and shell completion
- devvm --version (and a hidden devvm version) prints the version alone:
  the one release builds set with -ldflags -X .../internal/cli.version,
  else Go's build info without the v, else (devel). No -v shorthand.
- devvm help [COMMAND], --help and -h stay Cobra's.
- devvm completion bash|zsh|fish prints Cobra's script (no powershell).
  Completion offers image names after the +-joined parts given (base,
  the toolchains, the user's layers, the agents), shared tools for
  remove, backend names for --backend, all/none for --ports, and never
  file names.
- Tests: version.txtar, completion.txtar, help cases in root.txtar;
  TestJoined, TestVersionFromRelease, TestVersionFlagHasNoShorthand;
  more exit codes in TestExecuteExitCodes; docgen tests know the
  completion page and keep version and __complete out.
- Docs: commands.md "devvm itself" and "Shell completion"; the CLI
  reference regenerated (devvm_completion.md, --version on devvm.md).
- Converted: cli.bats "doctor: all there; --version prints VERSION"
  (its --version half; doctor waits for doctor). No messages added.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 15:52:27 -06:00

38 lines
936 B
Plaintext

# devvm --help prints usage.
exec devvm --help
stdout '^Usage:'
stdout 'devvm \[IMAGE\] \[flags\]'
! stderr .
cp stdout help.txt
# So do devvm help and -h; devvm help COMMAND prints the command's.
exec devvm help
cmp stdout help.txt
exec devvm -h
cmp stdout help.txt
exec devvm help build
stdout 'devvm build IMAGE \[flags\]'
exec devvm build --help
stdout 'devvm build IMAGE \[flags\]'
! stub_calls
# An unknown flag fails in one line on stderr, like every error.
! exec devvm --nope
cmp stderr nope-flag.txt
! stdout .
# So does a command given too many arguments.
! exec devvm build a b
cmp stderr build-args.txt
! stdout .
# In names mode, the parser's error is the message's value.
env DEVVM_MESSAGES=names
! exec devvm --nope
stderr '^devvm: usage_error reason=unknown flag: --nope$'
-- nope-flag.txt --
devvm: unknown flag: --nope: see devvm --help
-- build-args.txt --
devvm: accepts 1 arg(s), received 2: see devvm --help