Files
devvm/testdata/script/completion.txtar
T
w3cjandClaude Opus 5.5 b03293b7d7 feat(setup): devvm setup chooses base's features and the default backend
devvm setup asks which features base gets, starting from the current
choice (every feature until there's one; kept without a terminal), or
takes them from --features LIST without asking ('' for none), saved in
the features' run order. A name that isn't a feature is no_feature and
saves nothing. --backend NAME saves the default backend new VMs get
(~/.config/devvm/backend, read by the registry), checked against the
backends devvm has; alone, it leaves the features as they are.

A changed choice prints base_will_rebuild, and gc_old_hint once any
image record exists. base_features and base_features_none name devvm
setup. --features completes feature names, setup's --backend backend
names.

- build: PickFeatures, SetFeatures (the first build's choice goes
  through PickFeatures)
- state: AnyImage
- messages: no_feature, base_will_rebuild, gc_old_hint,
  default_backend, setup_failed
- tests: setup.txtar, completion.txtar; TestPickFeatures,
  TestSetFeatures, TestAnyImage
- docs: customizing.md (choosing features), backends.md (choosing a
  backend), the CLI reference

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 21:21:07 -06:00

62 lines
1.5 KiB
Plaintext

# devvm completion prints a script for bash, zsh and fish, and nothing else.
exec devvm completion bash
stdout '__devvm'
! stderr .
exec devvm completion zsh
stdout '^#compdef devvm$'
exec devvm completion fish
stdout 'complete -c devvm'
! exec devvm completion powershell
stderr '^devvm: invalid argument "powershell" for "devvm completion": see devvm --help$'
! stdout .
# The commands users run, not the hidden ones, with image names for IMAGE.
exec devvm __complete ''
stdout '^build\t'
stdout '^completion\t'
stdout '^base$'
stdout '^claude$'
! stdout '^_'
! stdout '^version'
stdout '^:4$'
# Your layers are image names; the parts given are left out.
mkdir $XDG_CONFIG_HOME/devvm/layers
cp foo.sh $XDG_CONFIG_HOME/devvm/layers/foo.sh
exec devvm __complete build node+
stdout '^node\+foo$'
stdout '^node\+claude$'
! stdout '^node\+node$'
exec devvm __complete node+c
cmp stdout node-c.txt
# remove takes shared tools only.
exec devvm __complete remove ''
stdout '^python$'
! stdout '^foo$'
! stdout '^base$'
# Flags: backend names, the ports keywords; never file names.
exec devvm __complete --backend ''
stdout '^lima$'
exec devvm __complete setup --backend ''
stdout '^lima$'
exec devvm __complete setup --features fzf,
stdout '^fzf,omb$'
! stdout '^fzf,fzf$'
exec devvm __complete --ports ''
stdout '^all$'
stdout '^none$'
exec devvm __complete rm ''
stdout '^:4$'
exec devvm __complete completion ''
stdout '^fish$'
! stub_calls
-- foo.sh --
#!/bin/bash
-- node-c.txt --
node+claude
node+codex
:4