pwdx: New completion.

This commit is contained in:
Ville Skyttä 2011-05-30 23:38:40 +03:00
parent fa2876b51d
commit 5bb9343fba
3 changed files with 37 additions and 0 deletions

View File

@ -57,6 +57,22 @@ have pgrep && complete -F _pgrep pgrep
# Linux pidof(8) completion.
[ $UNAME = Linux ] && complete -F _pgrep pidof
have pwdx &&
_pwdx()
{
local cur prev words cword
_init_completion || return
[[ $prev == -V ]] && return
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '-V' -- "$cur" ) )
else
_pids
fi
} &&
complete -F _pwdx pwdx
# Local variables:
# mode: shell-script
# sh-basic-offset: 4

1
test/completion/pwdx.exp Normal file
View File

@ -0,0 +1 @@
assert_source_completions pwdx

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "pwdx "
sync_after_int
teardown