diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-04-15 01:19:02 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2017-04-18 20:14:47 +0000 |
| commit | 6cc6942cf5df0bff0a39da2e1707c82ad0987f66 (patch) | |
| tree | fa157645695a08d9b5b94cf097544f36fd177fd5 | |
| parent | 40977: "emulate" disallows "--help" and "--version" (diff) | |
| download | zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.tar zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.tar.gz zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.tar.bz2 zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.tar.lz zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.tar.xz zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.tar.zst zsh-6cc6942cf5df0bff0a39da2e1707c82ad0987f66.zip | |
40973: _remote_files: Fix completion of remote files that start with a hyphen/minus.
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | Completion/Unix/Type/_remote_files | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2017-04-18 Daniel Shahaf <d.s@daniel.shahaf.name> + + * 40973: Completion/Unix/Type/_remote_files: Fix completion of + remote files that start with a hyphen/minus. + 2017-04-15 Barton E. Schaefer <schaefer@zsh.org> * 40977: Src/init.c: "emulate" disallows "--help" and "--version" 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 |
