diff options
Diffstat (limited to 'completions')
-rw-r--r-- | completions/bash/podman | 2 | ||||
-rw-r--r-- | completions/zsh/_podman | 19 |
2 files changed, 7 insertions, 14 deletions
diff --git a/completions/bash/podman b/completions/bash/podman index c23d156bc..ca3618b0b 100644 --- a/completions/bash/podman +++ b/completions/bash/podman @@ -366,7 +366,7 @@ __podman_to_extglob() { # continue processing its completion. # # TODO if the preceding command has options that accept arguments and an -# argument is equal ot one of the subcommands, this is falsely detected as +# argument is equal to one of the subcommands, this is falsely detected as # a match. __podman_subcommands() { local subcommands="$1" 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" } |