Skip to content

fix: add misc fixes before _comp_compgen_split #985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 22, 2023
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
4 changes: 2 additions & 2 deletions completions/7z
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ _comp_cmd_7z()
else
if [[ ${words[1]} == d ]]; then
local IFS=$'\n'
COMPREPLY=($(compgen -W "$(printf '%s\n' "$("$1" l "${words[2]}" \
COMPREPLY=($(compgen -W "$("$1" l "${words[2]}" \
-slt 2>/dev/null | command sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \
2>/dev/null | tail -n+2)")" -- "$cur"))
2>/dev/null | tail -n+2)" -- "$cur"))
compopt -o filenames
else
_comp_compgen_filedir
Expand Down
3 changes: 1 addition & 2 deletions completions/curl
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ _comp_cmd_curl()

if [[ $cur == -* ]]; then
_comp_compgen_help -- --help all
[[ ${COMPREPLY-} ]] ||
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
[[ ${COMPREPLY-} ]] || _comp_compgen_help
fi
} &&
complete -F _comp_cmd_curl curl
Expand Down
2 changes: 1 addition & 1 deletion completions/koji
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ _comp_cmd_koji()
fi

if [[ $cur == -* ]]; then
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
_comp_compgen_help
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
elif [[ ! $has_command ]]; then
COMPREPLY=($(compgen -W '$("$1" --help-commands 2>/dev/null | \
Expand Down
4 changes: 2 additions & 2 deletions completions/lspci
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ _comp_cmd_lspci()
return
;;
-*A)
COMPREPLY+=($(compgen -W '$("$1" -A help | command grep -vF :)' \
COMPREPLY=($(compgen -W '$("$1" -A help | command grep -vF :)' \
-- "$cur"))
return
;;
-*H)
_comp_compgen -a -- -W "1 2"
_comp_compgen -- -W "1 2"
return
;;
-*F)
Expand Down
2 changes: 1 addition & 1 deletion completions/medusa
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _comp_cmd_medusa()
;;
-*M)
COMPREPLY=($(compgen -W "$("$1" -d | awk '/^ +\+/ {print $2}' |
command sed -e 's/\.mod$//')"))
command sed -e 's/\.mod$//')" -- "$cur"))
return
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion completions/pgrep
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _comp_cmd_pgrep()
;;
--nslist)
COMPREPLY=(
$(IFS="$IFS," compgen -W '$("$1" --help 2>&1 |
$(IFS=$' \t\n,' compgen -W '$("$1" --help 2>&1 |
command sed -ne \
"s/^[[:space:]]*Available namespaces://p")' \
-- "${cur##*,}"))
Expand Down
2 changes: 1 addition & 1 deletion completions/pydoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ _comp_cmd_pydoc()
COMPREPLY+=($(compgen -W \
'$("$1" keywords topics | command sed -e /^Here/d)' -- "$cur"))

_comp_compgen_filedir py
_comp_compgen -a filedir py
} &&
complete -F _comp_cmd_pydoc pydoc pydoc3

Expand Down
2 changes: 1 addition & 1 deletion completions/reportbug
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _comp_cmd_reportbug()
return
;;
--tag | --ui | --interface | --type | --bts | --severity | --mode | -${noargopts}[TutBS])
COMPREPLY+=($(
COMPREPLY=($(
compgen -W \
'$("$1" "$prev" help 2>&1 | sed -ne "/^[[:space:]]/p")' \
-- "$cur"
Expand Down
2 changes: 1 addition & 1 deletion completions/tar
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ _comp_cmd_tar__try_list_archive()
while read -r line; do
printf "%q\n" "$(printf %q"\n" "$line")"
done
)" -- "$(printf "%q\n" "$cur")"))
)" -- "$(printf %q "$cur")"))
return 0
fi
}
Expand Down