From 60da3a663ed070c1e6c5d2a1b171e316a0395bbd Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 1 Dec 2026 05:13:36 +0000 Subject: enstate: --pack --dry-run, every problem of a source list Reads every source and writes nothing: every problem, not just the first, by address, with kind, location and variables, and the source, as text or JSON (--json): an item the schema has no slot for, a record in a type without records, a required slot without an item, a location that doesn't exist, a source that can't be read (with what it said), a record that isn't JSON. Exit status 1 if there are problems. --pack itself refuses with the same list; --out isn't for a dry run, --json only for one. The completion offers accordingly. --- share/bash-completion/completions/enstate | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/bash-completion/completions/enstate b/share/bash-completion/completions/enstate index 8e55c18..dc90101 100644 --- a/share/bash-completion/completions/enstate +++ b/share/bash-completion/completions/enstate @@ -44,7 +44,13 @@ _enstate() { status) options="--json $store" ;; materialize) options="--json $store --sandbox" ;; migrate) options="--json --dry-run $store --sandbox" ;; - pack) options="--out $general --schema" ;; + pack) + # a dry run writes nothing, and only it prints JSON + case $used in + *" --dry-run "* | *" --json "*) options="--dry-run --json $general --schema" ;; + *" --out "*) options="--out $general --schema" ;; + *) options="--out --dry-run --json $general --schema" ;; + esac ;; esac local o candidates= for o in $options; do -- cgit v1.3.1