forked from mikoto2000/devcontainer.vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbash_complete_func.bash
49 lines (47 loc) · 1.84 KB
/
bash_complete_func.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
_completion_devcontainer_vim(){
local prev cur cword
_get_comp_words_by_ref -n : cur prev cword
local commands="run templates start stop down config vimrc runargs tool clean index self-update help"
local subcommands_run=""
local subcommands_templates="apply"
local subcommands_tool="vim devcontainer clipboard-data-receiver"
local subcommands_tool_vim="download"
local subcommands_tool_nvim="download"
local subcommands_tool_devcontainer="download"
local subcommands_tool_clipboard_data_receiver="download"
local subcommands_index="update"
if [[ ${cword} -eq 1 ]]; then
COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
else
case "${prev}" in
run)
COMPREPLY=( $(compgen -W "${subcommands_run}" -- "${cur}") )
;;
templates)
COMPREPLY=( $(compgen -W "${subcommands_templates}" -- "${cur}") )
;;
tool)
COMPREPLY=( $(compgen -W "${subcommands_tool}" -- "${cur}") )
;;
vim)
COMPREPLY=( $(compgen -W "${subcommands_tool_vim}" -- "${cur}") )
;;
nvim)
COMPREPLY=( $(compgen -W "${subcommands_tool_nvim}" -- "${cur}") )
;;
devcontainer)
COMPREPLY=( $(compgen -W "${subcommands_tool_devcontainer}" -- "${cur}") )
;;
clipboard-data-receiver)
COMPREPLY=( $(compgen -W "${subcommands_tool_clipboard_data_receiver}" -- "${cur}") )
;;
index)
COMPREPLY=( $(compgen -W "${subcommands_index}" -- "${cur}") )
;;
*)
COMPREPLY=()
;;
esac
fi
} &&
complete -F _completion_devcontainer_vim devcontainer.vim bash-complete-func