diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2013-03-16 20:48:15 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2013-03-16 20:48:15 +0200 |
commit | 99153fb1ef75b9beec2d85966883bf3e99d095ad (patch) | |
tree | 256ada1cd9d23068b439f3d22cf1b334ccbdb7f2 | |
parent | 2f2f1278c7ae535d1c3763370e22e7f4083a50e7 (diff) | |
download | bash-completion-99153fb1ef75b9beec2d85966883bf3e99d095ad.tar.gz |
lua: New completion.
-rw-r--r-- | completions/Makefile.am | 1 | ||||
-rw-r--r-- | completions/lua | 23 | ||||
-rw-r--r-- | test/completion/lua.exp | 1 | ||||
-rw-r--r-- | test/lib/completions/lua.exp | 18 |
4 files changed, 43 insertions, 0 deletions
diff --git a/completions/Makefile.am b/completions/Makefile.am index 1160813f..7f628b58 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -182,6 +182,7 @@ bashcomp_DATA = a2x \ lpr \ lrzip \ lsof \ + lua \ luseradd \ luserdel \ lvm \ diff --git a/completions/lua b/completions/lua new file mode 100644 index 00000000..83dc7368 --- /dev/null +++ b/completions/lua @@ -0,0 +1,23 @@ +# lua(1) completion -*- shell-script -*- + +_lua() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -e|-l|-v|-) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + return + fi + + _filedir 'l@(ua|?(ua)c)' +} && +complete -F _lua lua + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/lua.exp b/test/completion/lua.exp new file mode 100644 index 00000000..a5774f4f --- /dev/null +++ b/test/completion/lua.exp @@ -0,0 +1 @@ +assert_source_completions lua diff --git a/test/lib/completions/lua.exp b/test/lib/completions/lua.exp new file mode 100644 index 00000000..864b1bfc --- /dev/null +++ b/test/lib/completions/lua.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "lua " +sync_after_int + + +teardown |