diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2013-03-16 20:49:41 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2013-03-16 20:49:41 +0200 |
commit | 29f5a4a5f4403f246e22fb8c2133e8696d2f0e41 (patch) | |
tree | 92879fd6e84568784849c3ad6dab473fddca8604 | |
parent | 99153fb1ef75b9beec2d85966883bf3e99d095ad (diff) | |
download | bash-completion-29f5a4a5f4403f246e22fb8c2133e8696d2f0e41.tar.gz |
luac: New completion.
-rw-r--r-- | completions/Makefile.am | 1 | ||||
-rw-r--r-- | completions/luac | 27 | ||||
-rw-r--r-- | test/completion/luac.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/luac.exp | 18 |
4 files changed, 47 insertions, 0 deletions
diff --git a/completions/Makefile.am b/completions/Makefile.am index 7f628b58..c195fb5f 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -183,6 +183,7 @@ bashcomp_DATA = a2x \ lrzip \ lsof \ lua \ + luac \ luseradd \ luserdel \ lvm \ diff --git a/completions/luac b/completions/luac new file mode 100644 index 00000000..a0330735 --- /dev/null +++ b/completions/luac @@ -0,0 +1,27 @@ +# luac(1) completion -*- shell-script -*- + +_luac() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -v|-) + return + ;; + -o) + _filedir + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + return + fi + + _filedir lua +} && +complete -F _luac luac + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/luac.exp b/test/completion/luac.exp new file mode 100644 index 00000000..63f49ee7 --- /dev/null +++ b/test/completion/luac.exp @@ -0,0 +1 @@ +assert_source_completions luac diff --git a/test/lib/completions/luac.exp b/test/lib/completions/luac.exp new file mode 100644 index 00000000..d7cfb23b --- /dev/null +++ b/test/lib/completions/luac.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "luac " +sync_after_int + + +teardown |