Skip to content

Commit

Permalink
eject: New completion.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Aug 19, 2012
1 parent 904faab commit b9276c8
Show file tree
Hide file tree
Showing 4 changed files with 50 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 @@ -75,6 +75,7 @@ bashcomp_DATA = a2x \
dumpe2fs \
e2freefrag \
e2label \
eject \
eog \
ether-wake \
evince \
Expand Down
30 changes: 30 additions & 0 deletions completions/eject
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# bash completion for eject(1) -*- shell-script -*-

_eject()
{
local cur prev words cword
_init_completion || return

case $prev in
-h|--help|-V|--version|-c|--changerslot|-x|--cdspeed)
return
;;
-a|--auto|-i|--manualeject)
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
return
;;
esac

if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
return
elif [[ $prev == @(-d|--default) ]]; then
return
fi

_cd_devices
_dvd_devices
} &&
complete -F _eject eject

# ex: ts=4 sw=4 et filetype=sh
1 change: 1 addition & 0 deletions test/completion/eject.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assert_source_completions eject
18 changes: 18 additions & 0 deletions test/lib/completions/eject.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 "eject -"
sync_after_int


teardown

0 comments on commit b9276c8

Please sign in to comment.