completion/getopt: use `-X '!&*'`

pull/1985/head^2
John D Pell 2022-01-16 11:38:56 -08:00
parent cd366fc8a5
commit 67869422b9
1 changed files with 3 additions and 3 deletions

View File

@ -21,15 +21,15 @@ function _getopt() {
case $prev in case $prev in
-s | --shell) -s | --shell)
read -d '' -ra COMPREPLY < <(compgen -W "${SHELL_ARGS[*]}" -- "$cur") COMPREPLY=("${SHELL_ARGS[@]}")
;; ;;
-n | --name) -n | --name)
read -d '' -ra COMPREPLY < <(compgen -A function -- "$cur") read -d '' -ra COMPREPLY < <(compgen -A function -- "$cur")
;; ;;
*) *)
read -d '' -ra COMPREPLY < <(compgen -W "${OPTIONS[*]}" -- "$cur") COMPREPLY=("${OPTIONS[@]}")
;; ;;
esac esac
} }
complete -F _getopt getopt complete -F _getopt -X '!&*' getopt