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