Created attachment 551337 [details] patch against /usr/share/bash-completion/ssh There's no ssh-add bash completion. ssh -i {tab} , sftp -i {tab} etc.. gives any old file. Version-Release number of selected component (if applicable): Name : bash-completion Arch : noarch Epoch : 1 Version : 1.3 Release : 6.fc16 Size : 576 k Repo : installed From repo : Fedora 16 - x86_64 patch gives this functionality
I've added a simple ssh-add completion upstream. Regarding the rest of the patch, here's some comments: This is something that should really be submitted upstream. If you like, I can do that for you, but I believe efore it will be accepted upstream, there are some things that should be addressed: - Drop the unimplemented _ssh_pkcs11 stuff - Observe coding style, initialization, indentation etc of existing completions - Non-local "match" variable leak from _ssh_identity_files - Unportable use of grep: -m is definitely unportable, and some grep versions don't even have -E. - Should offer also IdentityFiles from ssh's configs (non-blocker). Additionally, a lot of things have changed since version 1.3 of bash-completion; rawhide has 1.90 but patches submitted upstream should be done against upstream git: http://bash-completion.alioth.debian.org/ See also CONTRIBUTING in http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=blob;f=README
upstream patch done; https://github.com/grooverdan/bash-completion/tree/ssh-identityfile
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313507&group_id=100114 Thanks, closing here as upstream.