mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
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]>
62 lines
1.5 KiB
Plaintext
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
|