about summary refs log tree commit diff
diff options
context:
space:
mode:
authorXavier Hsinyuan <me@lstlx.com>2021-10-15 18:56:46 +0800
committerdana <dana@dana.is>2021-10-16 20:23:41 -0500
commit0f1e4d8e78a9692eaf38da8fd4ee6b23b75e2fdf (patch)
tree865b1d93aed5ae81f41575098096443b48296b17
parent713588e2350ef2257f2f8a934041832234876b92 (diff)
downloadzsh-0f1e4d8e78a9692eaf38da8fd4ee6b23b75e2fdf.tar.gz
zsh-0f1e4d8e78a9692eaf38da8fd4ee6b23b75e2fdf.tar.xz
zsh-0f1e4d8e78a9692eaf38da8fd4ee6b23b75e2fdf.zip
github #79 (tweaked): _ssh: update options in apple's version of ssh-add
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/_ssh16
2 files changed, 19 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 81d8c699e..0428248de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-10-16  dana  <dana@dana.is>
+
+	* github #79 (tweaked): Xavier Hsinyuan:
+	Completion/Unix/Command/_ssh: update options in apple's version
+	of ssh-add
+
 2021-10-13  Matthew Martin  <phy1729@gmail.com>
 
 	* 49441: Completion/Unix/Command/_timeout: Add OpenBSD.
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index 20087174c..2385272f1 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -81,9 +81,19 @@ _ssh () {
       '*:file:->file' "$common[@]" "$common_transfer[@]" && ret=0
     ;;
   ssh-add)
-    [[ $OSTYPE == darwin* ]] && args=(
-      '-A[add identities from keychain]'
-      '-K[update keychain when adding/removing identities]'
+    if [[ $OSTYPE != darwin* || $APPLE_SSH_ADD_BEHAVIOR == openssh ]]; then
+      args=(
+        '-K[load resident keys from a FIDO authenticator]'
+      )
+    else
+      [[ ${APPLE_SSH_ADD_BEHAVIOR:-macos} == macos ]] && args=(
+        '-A[add identities from keychain]'
+        '-K[update keychain when adding/removing identities]'
+      )
+    fi
+    [[ $OSTYPE == darwin<20->.* ]] && args+=(
+      '--apple-load-keychain[add identities from keychain]'
+      '--apple-use-keychain[update keychain when adding/removing identities]'
     )
     _arguments -s : $args \
       '-c[identity is subject to confirmation via SSH_ASKPASS]' \