Bug 772377

Summary: bashcompletion for the ssh family doesn't auto identify ssh identity-files
Product: [Fedora] Fedora Reporter: Daniel Black <daniel.black>
Component: bash-completionAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 16CC: sheltren, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-13 20:56:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
patch against /usr/share/bash-completion/ssh none

Description Daniel Black 2012-01-07 05:29:03 UTC
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

Comment 1 Ville Skyttä 2012-01-07 07:55:33 UTC
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

Comment 2 Daniel Black 2012-01-09 01:35:41 UTC
upstream patch done; https://github.com/grooverdan/bash-completion/tree/ssh-identityfile

Comment 3 Ville Skyttä 2012-01-13 20:56:13 UTC
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313507&group_id=100114

Thanks, closing here as upstream.