Skip to content

Commit cb347cb

Browse files
committed
fix(ps,ss): avoid extra expansions by -W "$(...)" in _comp_delimited
1 parent 49997d0 commit cb347cb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

completions/ps

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ _comp_cmd_ps()
5050
--format | ?(-)[Oo] | [^-]*[Oo])
5151
# TODO: This doesn't work well when there are multiple options for
5252
# the non-first item (similarly to useradd --groups and others).
53-
_comp_delimited , -W "$("$1" L | awk '{ print $1 }')"
53+
local labels=$("$1" L | awk '{ print $1 }')
54+
_comp_delimited , -W '$labels'
5455
return
5556
;;
5657
esac

completions/ss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ _comp_cmd_ss()
1616
return
1717
;;
1818
--query | -${noargopts}A)
19-
_comp_delimited , -W "$("$1" --help |
20-
command sed -e 's/|/ /g' -ne 's/.*QUERY := {\([^}]*\)}.*/\1/p')"
19+
local queries=$("$1" --help |
20+
command sed -e 's/|/ /g' -ne 's/.*QUERY := {\([^}]*\)}.*/\1/p')
21+
_comp_delimited , -W '$queries'
2122
return
2223
;;
2324
--diag | --filter | -${noargopts}[DF])

0 commit comments

Comments
 (0)