Permalink
Browse files

pv: New completion

  • Loading branch information...
scop committed Nov 9, 2017
1 parent 55ed68d commit f6f5f4f1fe8e225e06ca5174e6e36899a7baf81c
Showing with 56 additions and 0 deletions.
  1. +1 −0 completions/Makefile.am
  2. +30 −0 completions/pv
  3. +1 −0 test/completion/pv.exp
  4. +24 −0 test/lib/completions/pv.exp
View
@@ -296,6 +296,7 @@ bashcomp_DATA = 2to3 \
protoc \
psql \
puppet \
pv \
pwck \
pwd \
pwdx \
View
@@ -0,0 +1,30 @@
# pv(1) completion -*- shell-script -*-
_pv()
{
local cur prev words cword
_init_completion || return
case $prev in
-h|--help|-V|--version|-A|--last-written|-F|--format|-D|--delay-start|\
-i|--interval|-w|--width|-H|--height|-N|--name|-L|--rate-limit|\
-B|--buffer-size)
return
;;
-R|--remote)
_pids
return
;;
-P|--pidfile|-d|--watchfd)
_filedir pid
return
;;
esac
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
else
_filedir
fi
} &&
complete -F _pv pv
View
@@ -0,0 +1 @@
assert_source_completions pv
@@ -0,0 +1,24 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "pv "
sync_after_int
assert_complete_any "pv -"
sync_after_int
assert_complete_any "pv --pidfile "
sync_after_int
teardown

0 comments on commit f6f5f4f

Please sign in to comment.