diff --git a/completions/ps b/completions/ps index d32083ecea4..38732d183b2 100644 --- a/completions/ps +++ b/completions/ps @@ -50,7 +50,8 @@ _comp_cmd_ps() --format | ?(-)[Oo] | [^-]*[Oo]) # TODO: This doesn't work well when there are multiple options for # the non-first item (similarly to useradd --groups and others). - _comp_delimited , -W "$("$1" L | awk '{ print $1 }')" + local labels=$("$1" L | awk '{ print $1 }') + _comp_delimited , -W '$labels' return ;; esac diff --git a/completions/ss b/completions/ss index 08ddf5edc0a..e383fe57a8a 100644 --- a/completions/ss +++ b/completions/ss @@ -16,8 +16,9 @@ _comp_cmd_ss() return ;; --query | -${noargopts}A) - _comp_delimited , -W "$("$1" --help | - command sed -e 's/|/ /g' -ne 's/.*QUERY := {\([^}]*\)}.*/\1/p')" + local queries=$("$1" --help | + command sed -e 's/|/ /g' -ne 's/.*QUERY := {\([^}]*\)}.*/\1/p') + _comp_delimited , -W '$queries' return ;; --diag | --filter | -${noargopts}[DF])