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
6 changes: 3 additions & 3 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -2072,12 +2072,12 @@ if [[ $OSTYPE == *@(solaris|aix)* ]]; then
# This function completes on process IDs.
_comp_compgen_pids()
{
_comp_compgen_split -- "$(command ps -efo pid | command sed 1d)"
_comp_compgen_split -- "$(command ps -efo pid | tail -n +2)"
}

_comp_compgen_pgids()
{
_comp_compgen_split -- "$(command ps -efo pgid | command sed 1d)"
_comp_compgen_split -- "$(command ps -efo pgid | tail -n +2)"
}
_comp_compgen_pnames()
{
Expand All @@ -2098,7 +2098,7 @@ else
{
local -a procs=()
if [[ ${1-} == -s ]]; then
_comp_split procs "$(command ps ax -o comm | command sed -e 1d)"
_comp_split procs "$(command ps ax -o comm | tail -n +2)"
else
# Some versions of ps don't support "command", but do "comm", e.g.
# some busybox ones. Fall back
Expand Down
2 changes: 1 addition & 1 deletion completions-core/2to3.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _comp_cmd_2to3()
;;
-f | --fix | -x | --nofix)
_comp_compgen_split -- "$(
"$1" --list-fixes 2>/dev/null | command sed -e 1d
"$1" --list-fixes 2>/dev/null | tail -n +2
)"
return
;;
Expand Down
2 changes: 1 addition & 1 deletion completions-core/7z.bash
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ _comp_cmd_7z()
if [[ ${words[1]} == d ]]; then
_comp_compgen_split -l -- "$(
"$1" l "${words[2]}" -slt 2>/dev/null | command sed -n \
'/^Path =/s/^Path = \(.*\)$/\1/p' 2>/dev/null | tail -n+2
's/^Path = \(.*\)$/\1/p' 2>/dev/null | tail -n+2
)"
compopt -o filenames
else
Expand Down
2 changes: 1 addition & 1 deletion completions-core/cfrun.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ _comp_cmd_cfrun()
done
[[ ! -f $hostfile ]] && return

_comp_compgen_split -- "$(command grep -v -E '(=|^$|^#)' \
_comp_compgen_split -- "$(command grep -v -E '=|^$|^#' \
"$hostfile")"
fi
;;
Expand Down
2 changes: 1 addition & 1 deletion completions-core/curl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ _comp_cmd_curl()
return
;;
--proto-default)
_comp_compgen_split "$("$1" --version 2>/dev/null | command sed -e '/Protocols/!d' -e 's/Protocols://')"
_comp_compgen_split "$("$1" --version 2>/dev/null | command sed -n 's/Protocols://p')"
;;
--pubkey)
_comp_compgen -x ssh identityfile pub
Expand Down
2 changes: 1 addition & 1 deletion completions-core/fio.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_comp_cmd_fio__compgen_engines()
{
_comp_compgen_split -F $'\t\n' -- "$("$1" --enghelp 2>/dev/null | command sed -ne '/^[[:space:]]/p')"
_comp_compgen_split -F $'\t\n' -- "$("$1" --enghelp 2>/dev/null | command grep '^[[:space:]]')"
}

_comp_cmd_fio()
Expand Down
2 changes: 1 addition & 1 deletion completions-core/function.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _comp_cmd_function()
if ((cword == 1)); then
_comp_compgen -- -A function
else
local funcdef=$(type -- "${words[1]}" 2>/dev/null | command sed -e 1,2d)
local funcdef=$(type -- "${words[1]}" 2>/dev/null | tail -n +3)
COMPREPLY=("()${funcdef:+ $funcdef}")
fi
} &&
Expand Down
2 changes: 1 addition & 1 deletion completions-core/inotifywait.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _comp_cmd_inotifywait__events()
# wrapped explanations.
_comp_compgen -a split -- "$("$1" --help 2>/dev/null |
command sed -e '/^Events:/,/^[^'$'\t'']/!d' \
-ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p')"
-ne 's/^'$'\t''\([^[:blank:]]\{1,\}\)[[:blank:]].*/\1/p')"
}

_comp_cmd_inotifywait()
Expand Down
2 changes: 1 addition & 1 deletion completions-core/mcrypt.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _comp_cmd_mcrypt()
;;
-h | --hash)
_comp_compgen_split -- "$("$1" --list-hash 2>/dev/null |
command sed -e 1d)"
tail -n +2)"
return
;;
-k | -s | --key | --keysize)
Expand Down
2 changes: 1 addition & 1 deletion completions-core/mplayer.bash
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _comp_cmd_mplayer()
;;
-subcp | -msgcharset)
local cp
if _comp_split cp "$(iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null)"; then
if _comp_split cp "$(iconv --list 2>/dev/null | command sed -e "s@//@@" 2>/dev/null)"; then
if [[ $cur == "${cur,,}" ]]; then
_comp_compgen -- -W '"${cp[@],,}"'
else
Expand Down
6 changes: 3 additions & 3 deletions completions-core/msynctool.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ _comp_cmd_msynctool()
return
;;
--addmember)
_comp_compgen_split -- "$("$1" --listplugins | command sed -e 1d)"
_comp_compgen_split -- "$("$1" --listplugins | tail -n +2)"
return
;;
esac

case $prev in
--configure | --addgroup | --delgroup | --showgroup | --sync | --addmember)
_comp_compgen_split -- "$("$1" --listgroups | command sed -e 1d)"
_comp_compgen_split -- "$("$1" --listgroups | tail -n +2)"
return
;;
--showformats | --filter-objtype | --slow-sync)
_comp_compgen_split -- "$("$1" --listobjects | command sed -e 1d)"
_comp_compgen_split -- "$("$1" --listobjects | tail -n +2)"
return
;;
esac
Expand Down
3 changes: 1 addition & 2 deletions completions-core/pdftotext.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ _comp_cmd_pdftotext()
return
;;
-enc)
_comp_compgen_split -- "$("$1" -listenc 2>/dev/null |
command sed -e 1d)"
_comp_compgen_split -- "$("$1" -listenc 2>/dev/null | tail -n +2)"
return
;;
-eol)
Expand Down
3 changes: 1 addition & 2 deletions completions-core/sitecopy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ _comp_cmd_sitecopy()
esac

if [[ -r ~/.sitecopyrc ]]; then
_comp_compgen_split -- "$("$1" -v |
command sed -n '/^Site:/s/Site: //p')"
_comp_compgen_split -- "$("$1" -v | command sed -n 's/^Site: //p')"
fi
} &&
complete -F _comp_cmd_sitecopy -o default sitecopy
Expand Down
4 changes: 2 additions & 2 deletions completions-core/xgamma.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _comp_cmd_xgamma()
case "$prev" in
-screen)
local screens=$(xrandr --query 2>/dev/null | command sed -n \
'/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null)
's|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null)
_comp_compgen -- -W "$screens"
return
;;
Expand All @@ -31,7 +31,7 @@ _comp_cmd_xgamma()
elif [[ $cur == :*.* ]]; then
# local screen numbers
local screens=$(xrandr --query 2>/dev/null | command sed -ne \
'/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null)
's|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null)
cur=${cur#:}
_comp_compgen -P "${cur%.*}." -- -W '$screens'
elif [[ $cur != *:* ]]; then
Expand Down