Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion completions-core/ccache.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _comp_cmd_ccache()
--set-config | -${noargopts}o)
if [[ $cur != *=* ]]; then
_comp_compgen_split -S = -- "$("$1" -p 2>/dev/null |
_comp_awk '$3 = "=" { print $2 }')"
_comp_awk '$3 == "=" { print $2 }')"
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
fi
return
Expand Down
17 changes: 9 additions & 8 deletions completions-core/ebtables.bash
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ _comp_cmd_ebtables()
-${noargopts}j)
if [[ $table == "filter" || ! $table ]]; then
_comp_compgen -- -W '$targets'
_comp_compgen -a split -- "$("$1" ${table:+-t "$table"} -L \
2>/dev/null | command sed -n -e \
"s/INPUT//;s/OUTPUT//;s/FORWARD//" -e "$chain")"
_comp_compgen -a split -X '@(INPUT|OUTPUT|FORWARD)' \
-- "$("$1" ${table:+-t "$table"} -L 2>/dev/null |
command sed -ne "$chain")"
elif [[ $table == "nat" ]]; then
_comp_compgen -- -W '$targets'
_comp_compgen -a split -- "$("$1" -t "$table" -L 2>/dev/null |
command sed -n -e "s/OUTPUT//;s/PREROUTING//;s/POSTROUTING//" \
-e "$chain")"
_comp_compgen -a split -X '@(OUTPUT|PREROUTING|POSTROUTING)' \
-- "$("$1" -t "$table" -L 2>/dev/null |
command sed -ne "$chain")"
elif [[ $table == "broute" ]]; then
_comp_compgen -- -W 'ACCEPT DROP'
_comp_compgen -a split -- "$("$1" -t "$table" -L 2>/dev/null |
command sed -n -e "s/BROUTING//" -e "$chain")"
_comp_compgen -a split -X 'BROUTING' \
-- "$("$1" -t "$table" -L 2>/dev/null |
command sed -ne "$chain")"
fi
;;
*)
Expand Down
11 changes: 4 additions & 7 deletions completions-core/invoke-rc.d.bash
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ _comp_cmd_invoke_rc_d()
if [[ $cword -eq 1 || $prev == --* ]]; then
# generate valid_options
local IFS='|'
local regex_options="${options[*]}"
IFS=$' \t\n'
_comp_compgen_split -- "$(
tr " " "\n" <<<"${words[*]} ${options[*]}" |
command grep -E -e "$regex_options" |
sort | uniq -u
)"
local exclude="@(${words[*]})"
_comp_unlocal IFS
_comp_compgen -- -W '"${options[@]}"' -X "$exclude"

_comp_expand_glob services '"$sysvdir"/!(README*|*.sh|$_comp_backup_glob)' &&
_comp_compgen -a -- -W '"${services[@]#"$sysvdir"/}"'
elif [[ -x $sysvdir/$prev ]]; then
Expand Down
20 changes: 11 additions & 9 deletions completions-core/iptables.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ _comp_cmd_iptables()
-j)
if [[ $table == "filter" || ! $table ]]; then
_comp_compgen -- -W '$targets'
_comp_compgen -a split -- "$("$1" ${table:+-t "$table"} -nL \
2>/dev/null | command sed -ne "$chain" \
-e 's/INPUT//;s/OUTPUT//;s/FORWARD//;s/PREROUTING//;s/POSTROUTING//')"
_comp_compgen -a split \
-X '@(INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING)' \
-- "$("$1" ${table:+-t "$table"} -nL 2>/dev/null |
command sed -ne "$chain")"
elif [[ $table == "nat" ]]; then
_comp_compgen -- -W '$targets MIRROR SNAT DNAT MASQUERADE'
_comp_compgen -a split -- "$("$1" -t "$table" -nL 2>/dev/null |
command sed -ne "$chain" \
-e 's/OUTPUT//;s/PREROUTING//;s/POSTROUTING//')"
_comp_compgen -a split -X '@(OUTPUT|PREROUTING|POSTROUTING)' \
-- "$("$1" -t "$table" -nL 2>/dev/null |
command sed -ne "$chain")"
elif [[ $table == "mangle" ]]; then
_comp_compgen -- -W '$targets MARK TOS'
_comp_compgen -a split -- "$("$1" -t "$table" -nL 2>/dev/null |
command sed -ne "$chain" \
-e 's/INPUT//;s/OUTPUT//;s/FORWARD//;s/PREROUTING//;s/POSTROUTING//')"
_comp_compgen -a split \
-X '@(INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING)' \
-- "$("$1" -t "$table" -nL 2>/dev/null |
command sed -ne "$chain")"
fi
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion completions-core/xrandr.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _comp_cmd_xrandr__compgen_monitors()
{
_comp_compgen_split -- "$(
"$1" --listmonitors 2>/dev/null |
command sed -ne 's/.* [0-9]*: [+\*]*\([^ ]*\).*/\1/p'
command sed -ne 's/.* [0-9]*: [+*]*\([^ ]*\).*/\1/p'
)"
}

Expand Down