diff options
| author | tv <tv@krebsco.de> | 2026-11-19 21:00:40 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-19 22:10:36 +0100 |
| commit | edb4443510d7c8e4957e953093a25f9e7876493e (patch) | |
| tree | ed78864d7a71345c4af4da1e32ca7bbb4c2c20ed /share/bash-completion/completions/continuum-party | |
| parent | 59cc0283117be6b4195afbe857d702e7f8ddba6e (diff) | |
continuum-party get: what counts, as JSON, a path at a time
What counts is kept by place, each place's value whole: `values` showed
it so, a place a line, and `--json` as one object keyed by places. An
application holds it as one tree.
`get [PATH]` reads it so (tree, at): each place's value at its path, the
maps on its way made, so that `get home/tv` is one object of everything
under it, and `get home/tv/hosts/laptop/ip6` reaches into a place's
value, a list's items by their index. Where a place lies under another's
value, the deeper place is the later word there (merge). Nothing at a
path is an error. `-r` writes a string as it is, as jq -r does; other
values as JSON. Bash completes it with places and the paths on their
way.
Diffstat (limited to 'share/bash-completion/completions/continuum-party')
| -rw-r--r-- | share/bash-completion/completions/continuum-party | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/share/bash-completion/completions/continuum-party b/share/bash-completion/completions/continuum-party index de44be7..7834536 100644 --- a/share/bash-completion/completions/continuum-party +++ b/share/bash-completion/completions/continuum-party @@ -24,10 +24,12 @@ _continuum_party_parties() awk '/passing a change:$/ { on = 1; next } on && /^ [^ ]/ { print $1; next } { on = 0 }' } -# The places holding a value. +# The places holding a value, and the paths on their way. _continuum_party_places() { - _continuum_party_asking values | cut -d' ' -f1 + _continuum_party_asking values | cut -d' ' -f1 | + awk -F/ '{ path = $1; print path; for (i = 2; i <= NF; i++) { path = path "/" $i; print path } }' | + sort -u } # The features of the revisions the client knows, as `--version` names them. @@ -79,7 +81,7 @@ _continuum_party() local global_options='--node --token --key --record --federation --config --unset --help --version' local commands='init write keys nodes next propose vote again found root fork check - judge proposals show status values twice help' + judge proposals show status values get twice help' local intents='admit remove give take keys nodes checkpoint revision' # The command, the intent of `propose` and `fork`, and the arguments after them that @@ -216,9 +218,10 @@ _continuum_party() _continuum_party_words '--list --add --remove --set --force' fi ;; - write | values) + write | values | get) if [[ $cur == -* ]]; then [[ $command == values ]] && _continuum_party_words '--json' + [[ $command == get ]] && _continuum_party_words '-r --raw' elif ((n == 0)); then _continuum_party_words "$(_continuum_party_places)" fi |
