diff --git a/completions/Makefile.am b/completions/Makefile.am index 03165cf4..fabe1c24 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -2,6 +2,7 @@ bashcompdir = $(pkgdatadir)/completions bashcomp_DATA = a2x \ abook \ aclocal \ + acpi \ add_members \ alias \ ant \ diff --git a/completions/acpi b/completions/acpi new file mode 100644 index 00000000..ccc5b635 --- /dev/null +++ b/completions/acpi @@ -0,0 +1,23 @@ +# acpi(1) completion -*- shell-script -*- + +_acpi() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|--help|-v|--version) + return + ;; + -d|--directory) + _filedir -d + return + ;; + esac + + [[ $cur == -* ]] && \ + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _acpi acpi + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/acpi.exp b/test/completion/acpi.exp new file mode 100644 index 00000000..934f6d1c --- /dev/null +++ b/test/completion/acpi.exp @@ -0,0 +1 @@ +assert_source_completions acpi diff --git a/test/lib/completions/acpi.exp b/test/lib/completions/acpi.exp new file mode 100644 index 00000000..278cdceb --- /dev/null +++ b/test/lib/completions/acpi.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "acpi -" +sync_after_int + + +teardown