[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-337-g5bb9343
Ville Skyttä
ville.skytta at iki.fi
Mon May 30 20:38:48 UTC 2011
The following commit has been merged in the master branch:
commit 5bb9343fbaa0b0b71e66f792f48e3bd63dc8a218
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Mon May 30 23:38:40 2011 +0300
pwdx: New completion.
diff --git a/completions/procps b/completions/procps
index 32613bd..076e2b7 100644
--- a/completions/procps
+++ b/completions/procps
@@ -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
diff --git a/test/completion/pwdx.exp b/test/completion/pwdx.exp
new file mode 100644
index 0000000..dd97822
--- /dev/null
+++ b/test/completion/pwdx.exp
@@ -0,0 +1 @@
+assert_source_completions pwdx
diff --git a/test/lib/completions/a2ps.exp b/test/lib/completions/pwdx.exp
similarity index 80%
copy from test/lib/completions/a2ps.exp
copy to test/lib/completions/pwdx.exp
index 77cd07f..314623b 100644
--- a/test/lib/completions/a2ps.exp
+++ b/test/lib/completions/pwdx.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "a2ps "
+assert_complete_any "pwdx "
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list