| 1 |
# |
| 2 |
# bash/zsh completion support for neko/nekotools/nekoml/nekoc. |
| 3 |
# |
| 4 |
# This is free and unencumbered software released into the public domain. |
| 5 |
# |
| 6 |
# Anyone is free to copy, modify, publish, use, compile, sell, or |
| 7 |
# distribute this software, either in source code form or as a compiled |
| 8 |
# binary, for any purpose, commercial or non-commercial, and by any |
| 9 |
# means. |
| 10 |
|
| 11 |
__neko(){ |
| 12 |
local cur=${COMP_WORDS[COMP_CWORD]} |
| 13 |
COMPREPLY=($(compgen -f -X "!*.n" -- "${cur}")) |
| 14 |
} |
| 15 |
complete -d -X '.[^./]*' -F __neko neko |
| 16 |
|
| 17 |
__nekotools(){ |
| 18 |
local cur=${COMP_WORDS[COMP_CWORD]} |
| 19 |
#local prev=${COMP_WORDS[COMP_CWORD-1]} |
| 20 |
local opts="boot server" |
| 21 |
# TODO 2nd level args |
| 22 |
COMPREPLY=($(compgen -W "$opts" -- $cur)) |
| 23 |
} |
| 24 |
complete -F __nekotools nekotools |
| 25 |
|
| 26 |
__nekoml(){ |
| 27 |
local cur=${COMP_WORDS[COMP_CWORD]} |
| 28 |
COMPREPLY=($(compgen -f -X "!*.nml" -- "${cur}")) |
| 29 |
} |
| 30 |
complete -d -X '.[^./]*' -F __nekoml nekoml |
| 31 |
|
| 32 |
__nekoc(){ |
| 33 |
local cur=${COMP_WORDS[COMP_CWORD]} |
| 34 |
COMPREPLY=($(compgen -f -X "!*.neko" -- "${cur}")) |
| 35 |
} |
| 36 |
complete -d -X '.[^./]*' -F __nekoc nekoc |