[Bash-completion-devel] [bash-completion-Bugs][312122] [PATCH] Complete ssh -o SubOption=

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Thu Dec 24 14:06:44 UTC 2009


Bugs item #312122, was changed at 2009-11-30 21:29 by Ville Skyttä 
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312122&group_id=100114

>Status: Closed
Priority: 3
Submitted By: Leonard Crestez (cdleonard-guest)
>Assigned to: Ville Skyttä  (scop-guest)
Summary: [PATCH] Complete ssh -o SubOption= 
Distribution: None
Originally reported in: None
>Milestone: 2.0
>Status: Accepted
Original bug number: 


Initial Comment:
This patch adds completion to -o SubOptions (like -o ForwardAgent=yes|no) to ssh and sftp. It could also be added to scp but scp currently doesn't even complete -o.

This changes suboption completion (_ssh_options function) to suffix with = and set compopt -o nospace. This is required because ssh doesn't accept stuff like -o ForwardAgent no; only -o ForwardAgent=no and -o 'ForwardAgent no'. On bash <4 compopt is not supported; you'll have to backspace. This is not much of a regression since without this patch you'd have to backspace and type '=value' anyway.

The implementation uses `_get_cword :=` and `_get_cword := 1` to detect the -o SubOption= case. Presumably this could be done by changing the way $cur and $prev are evaluated in _ssh. That could break unrelated stuff and a _get_cword call is fast anyway.

----------------------------------------------------------------------

>Comment By: Ville Skyttä  (scop-guest)
Date: 2009-12-24 16:06

Message:
Good stuff, thanks!  Committed with minor changes.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312122&group_id=100114



More information about the Bash-completion-devel mailing list