aboutsummaryrefslogtreecommitdiff
path: root/completions
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-12-23 06:26:46 -0700
committerEd Santiago <santiago@redhat.com>2019-12-23 06:28:49 -0700
commit3467f24fce1f9919b9efde5a9e755f2e167bc972 (patch)
tree159010b7b5a3f633e03079f7028796c43ff36db2 /completions
parentfcd48db4d24f6dba4fb2652d72aa0d86e167aa0c (diff)
downloadpodman-3467f24fce1f9919b9efde5a9e755f2e167bc972.tar.gz
podman-3467f24fce1f9919b9efde5a9e755f2e167bc972.tar.bz2
podman-3467f24fce1f9919b9efde5a9e755f2e167bc972.zip
zsh completion: ignore multi-line output in Flags
PR #4475 introduced an interesting twist on --help: a help string that spans multiple lines. This broke zsh completion. I'm not keen on that multi-line output, but it shouldn't break completion. Fix is simple: look only for flag lines beginning with '-', filter out anything else. Fixes: #4738 Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'completions')
-rw-r--r--completions/zsh/_podman1
1 files changed, 1 insertions, 0 deletions
diff --git a/completions/zsh/_podman b/completions/zsh/_podman
index 228498066..06aa92748 100644
--- a/completions/zsh/_podman
+++ b/completions/zsh/_podman
@@ -47,6 +47,7 @@ _read_podman_flags() {
# The result will be, e.g. '-f,--foo=string Description of Option'
_call_program podman podman "$@" --help |\
sed -n -e '0,/^Flags:/d' -e '/^$/q;p' |\
+ grep '^ \+-' |\
sed -e 's/^ *//' -e 's/^\(-.,\) --/\1--/' |\
sed -e 's/^\(-[^ ]\+\) \([^ ]\+\) /\1=\2 /' |\
while read flags desc;do