From 6cc6942cf5df0bff0a39da2e1707c82ad0987f66 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 15 Apr 2017 01:19:02 +0000 Subject: 40973: _remote_files: Fix completion of remote files that start with a hyphen/minus. --- Completion/Unix/Type/_remote_files | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/Unix/Type/_remote_files b/Completion/Unix/Type/_remote_files index 1e9fed15e..a5fce9afd 100644 --- a/Completion/Unix/Type/_remote_files +++ b/Completion/Unix/Type/_remote_files @@ -58,11 +58,13 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then else rempat="${(q)PREFIX%%[^./][^/]#}\*" fi + # remote filenames remfiles=(${(M)${(f)"$(_call_program files $cmd $cmd_args $host ls -d1FL -- "$rempat" 2>/dev/null)"}%%[^/]#(|/)}) compset -P '*/' compset -S '/*' || (( ${args[(I)-/]} )) || suf='remote file' + # display strings for remote files and directories remdispf=(${remfiles:#*/}) remdispd=(${(M)remfiles:#*/}) @@ -77,9 +79,9 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then while _tags; do while _next_label files expl ${suf:-remote directory}; do [[ -n $suf ]] && - compadd "$args[@]" "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} && ret=0 + compadd "$args[@]" "$expl[@]" -d remdispf -- ${(q)remdispf%[*=|]} && ret=0 compadd ${suf:+-S/} -r "/ \t\n\-" "$args[@]" "$expl[@]" -d remdispd \ - ${(q)remdispd%/} && ret=0 + -- ${(q)remdispd%/} && ret=0 done (( ret )) || return 0 done -- cgit 1.4.1