diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-09 13:50:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 13:50:43 +0100 |
commit | aaf94c84e7167103753a5c718f87f0a6f33a8537 (patch) | |
tree | 47a2887081aa983b6cb48a081aa2f22d9ade720c /completions/zsh/_podman | |
parent | f3fc10feb42930def6922fc050096ea38bafed7a (diff) | |
parent | 3b2aa033c8f6abdf93e25f9e7bed7dd596fcfe34 (diff) | |
download | podman-aaf94c84e7167103753a5c718f87f0a6f33a8537.tar.gz podman-aaf94c84e7167103753a5c718f87f0a6f33a8537.tar.bz2 podman-aaf94c84e7167103753a5c718f87f0a6f33a8537.zip |
Merge pull request #4820 from edsantiago/consistent_option_enumerations
Usage messages: show possible option values
Diffstat (limited to 'completions/zsh/_podman')
-rw-r--r-- | completions/zsh/_podman | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/completions/zsh/_podman b/completions/zsh/_podman index 06aa92748..067eebbbb 100644 --- a/completions/zsh/_podman +++ b/completions/zsh/_podman @@ -111,20 +111,13 @@ _podman_find_helper() { elif expr "$desc" : ".*[Pp]ath" >/dev/null; then optval="path" helper=_files - elif [ "$flags" = "--cgroup-manager" ]; then - optval="cgroup manager" - helper="(cgroupfs systemd)" - elif [ "$flags" = "--log-level" ]; then - optval="log level" - # 'Log messages above specified level: debug, ... (default "...")' - # Strip off the description and all 'default' strings - desc=${desc/Log*:/} # debug, info, ... (default "...") - desc=${(S)desc//\(*\)/} # debug, info, ... or panic - desc=${desc//,/} # debug info ... or panic - desc=${desc// or / } # debug info ... panic - desc=${desc// / } # collapse multiple spaces + # For messages like 'restart policy ("always"|"no"|"on-failure") + elif optlist=$(expr "$desc" : '.*(\(\"[^\\)]\+|[^\\)]\+\"\))' 2>/dev/null); then + optval=${${flags##--}//-/ } # "--log-level" => "log level" + optlist=${optlist//\"/} # "a"|"b"|"c" => a|b|c + optlist=${optlist//\|/ } # a|b|c => a b c # FIXME: how to present values _in order_, not sorted alphabetically? - helper="($desc)" + helper="($optlist)" fi echo "$optval:$helper" } |