completion/getopt: `shfmt`
parent
8cdd226cf3
commit
9d4b23b992
|
|
@ -1,4 +1,6 @@
|
|||
__getopt() {
|
||||
# shellcheck shell=bash
|
||||
|
||||
function _getopt() {
|
||||
local OPTIONS=('-a' '--alternative'
|
||||
'-h' '--help'
|
||||
'-l' '--longoptions'
|
||||
|
|
@ -17,10 +19,10 @@ __getopt() {
|
|||
local previous=$3
|
||||
|
||||
case $previous in
|
||||
-s|--shell)
|
||||
-s | --shell)
|
||||
readarray -t COMPREPLY < <(compgen -W "${SHELL_ARGS[*]}" -- "$current")
|
||||
;;
|
||||
-n|--name)
|
||||
-n | --name)
|
||||
readarray -t COMPREPLY < <(compgen -A function -- "$current")
|
||||
;;
|
||||
*)
|
||||
|
|
@ -29,4 +31,4 @@ __getopt() {
|
|||
esac
|
||||
}
|
||||
|
||||
complete -F __getopt getopt
|
||||
complete -F _getopt getopt
|
||||
|
|
|
|||
Loading…
Reference in New Issue