[MacPorts] #44558: bash-completion on ssh hostname adds bad function, causes syntax errors
MacPorts
noreply at macports.org
Mon Aug 18 08:34:04 PDT 2014
#44558: bash-completion on ssh hostname adds bad function, causes syntax errors
--------------------------------+----------------------
Reporter: Daniel.Lipofsky@… | Owner: raimue@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.1
Resolution: | Keywords:
Port: bash-completion |
--------------------------------+----------------------
Comment (by Daniel.Lipofsky@…):
It's still a problem for me. I noticed you are using bash-
completion'''-devel''' @2.1_7 while I am using bash-completion @2.1_8. I
don't know if that could be the difference. Maybe compare to my _scp
definition. I've attached the file that defines it and also pinter the
definition from my bash shell.
{{{
$ find /opt/local/share/bash-completion/completions -xtype f | xargs -r
grep -l '_scp()' | xargs -r ls -l
lrwxr-xr-x 1 root admin 3 Apr 8 04:27 /opt/local/share/bash-
completion/completions/autossh -> ssh
lrwxr-xr-x 1 root admin 3 Apr 8 04:27 /opt/local/share/bash-
completion/completions/scp -> ssh
lrwxr-xr-x 1 root admin 3 Apr 8 04:27 /opt/local/share/bash-
completion/completions/sftp -> ssh
lrwxr-xr-x 1 root admin 3 Apr 8 04:27 /opt/local/share/bash-
completion/completions/slogin -> ssh
-rw-r--r-- 1 root admin 11766 Apr 8 04:27 /opt/local/share/bash-
completion/completions/ssh
$ type _scp
_scp is a function
_scp ()
{
local cur prev words cword;
_init_completion -n : || return;
local configfile prefix;
_ssh_suboption_check && {
COMPREPLY=("${COMPREPLY[@]/%/ }");
return 0
};
case $prev in
-l | -P)
return 0
;;
-F | -i | -S)
_filedir;
compopt +o nospace;
return 0
;;
-c)
_ssh_ciphers;
COMPREPLY=("${COMPREPLY[@]/%/ }");
return 0
;;
-o)
_ssh_options;
return 0
;;
esac;
_expand || return 0;
case $cur in
!(*:*)/* | [.~]*)
;;
*:*)
_scp_remote_files;
return 0
;;
esac;
if [[ "$cur" == -F* ]]; then
cur=${cur#-F};
prefix=-F;
else
set -- "${words[@]}";
while [[ $# -gt 0 ]]; do
if [[ $1 == -F* ]]; then
if [[ ${#1} -gt 2 ]]; then
configfile="$(dequote "${1:2}")";
else
shift;
[[ -n $1 ]] && configfile="$(dequote "$1")";
fi;
break;
fi;
shift;
done;
case $cur in
-*)
COMPREPLY=($( compgen -W '$( _parse_usage "${words[0]}" )'
-- "$cur" ));
COMPREPLY=("${COMPREPLY[@]/%/ }");
return 0
;;
*/* | [.~]*)
;;
*)
_known_hosts_real -c -a -F "$configfile" "$cur"
;;
esac;
fi;
_scp_local_files "$prefix";
return 0
}
}}}
--
Ticket URL: <https://trac.macports.org/ticket/44558#comment:5>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list