about summary refs log tree commit diff
diff options
context:
space:
mode:
-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]' \