From 0f1e4d8e78a9692eaf38da8fd4ee6b23b75e2fdf Mon Sep 17 00:00:00 2001 From: Xavier Hsinyuan Date: Fri, 15 Oct 2021 18:56:46 +0800 Subject: github #79 (tweaked): _ssh: update options in apple's version of ssh-add --- ChangeLog | 6 ++++++ Completion/Unix/Command/_ssh | 16 +++++++++++++--- 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 + + * github #79 (tweaked): Xavier Hsinyuan: + Completion/Unix/Command/_ssh: update options in apple's version + of ssh-add + 2021-10-13 Matthew Martin * 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]' \ -- cgit 1.4.1