[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-119-g28f15fd

Ville Skyttä ville.skytta at iki.fi
Sat Jan 7 07:43:00 UTC 2012


The following commit has been merged in the master branch:
commit 28f15fd05c28ee84e79ee2d5f17b5867e682efef
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Jan 7 09:42:53 2012 +0200

    ssh-add: New completion.

diff --git a/completions/Makefile.am b/completions/Makefile.am
index ba3cfb0..4773a72 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -284,6 +284,7 @@ bashcomp_DATA = a2x \
 		snownews \
 		sqlite3 \
 		ssh \
+		ssh-add \
 		ssh-copy-id \
 		sshfs \
 		sshmitm \
diff --git a/completions/ssh-add b/completions/ssh-add
new file mode 100644
index 0000000..1d56368
--- /dev/null
+++ b/completions/ssh-add
@@ -0,0 +1,23 @@
+# ssh-add(1) completion                                    -*- shell-script -*-
+
+_ssh_add()
+{
+    local cur prev words cword
+    _init_completion || return
+
+    case $prev in
+        -t|-s|-e)
+            return
+            ;;
+    esac
+
+    if [[ $cur == -* ]]; then
+        COMPREPLY=( $( compgen -W '$( _parse_help "$1" -? )' -- "$cur" ) )
+        return
+    fi
+
+    _filedir
+} &&
+complete -F _ssh_add ssh-add
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/ssh-add.exp b/test/completion/ssh-add.exp
new file mode 100644
index 0000000..03035cf
--- /dev/null
+++ b/test/completion/ssh-add.exp
@@ -0,0 +1 @@
+assert_source_completions ssh-add
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/ssh-add.exp
similarity index 79%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/ssh-add.exp
index 43f6272..2fb2a9b 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/ssh-add.exp
@@ -11,7 +11,7 @@ proc teardown {} {
 setup
 
 
-assert_complete_any "abook "
+assert_complete_any "ssh-add "
 
 
 sync_after_int

-- 
bash-completion



More information about the Bash-completion-commits mailing list