Skip to content

Commit

Permalink
lua: New completion.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Mar 16, 2013
1 parent 2f2f127 commit 99153fb
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions completions/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ bashcomp_DATA = a2x \
lpr \
lrzip \
lsof \
lua \
luseradd \
luserdel \
lvm \
Expand Down
23 changes: 23 additions & 0 deletions completions/lua
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test/completion/lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assert_source_completions lua
18 changes: 18 additions & 0 deletions test/lib/completions/lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
proc setup {} {
save_env
}


proc teardown {} {
assert_env_unmodified
}


setup


assert_complete_any "lua "
sync_after_int


teardown

0 comments on commit 99153fb

Please sign in to comment.