completion/getopt: use `-X '!&*'`
parent
cd366fc8a5
commit
67869422b9
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue