Skip to content

Commit

Permalink
hwclock: New completion.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Apr 4, 2012
1 parent 0ab693c commit 3d7102b
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 @@ -119,6 +119,7 @@ bashcomp_DATA = a2x \
hping2 \
htop \
htpasswd \
hwclock \
iconv \
id \
idn \
Expand Down
23 changes: 23 additions & 0 deletions completions/hwclock
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# hwclock(8) completion -*- shell-script -*-

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

case $prev in
-h|--help|-V|--version|--date|--epoch)
return
;;
-f|--rtc|--adjfile)
_filedir
;;
esac

[[ $cur == -* ]] && \
COMPREPLY=( $( PATH="$PATH:/sbin"
compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
} &&
complete -F _hwclock hwclock

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


teardown

0 comments on commit 3d7102b

Please sign in to comment.