OSDN Git Service

completion/rsync: Complete local pathnames
authormagicant <magicant@048f04df-13f5-43d7-8114-9f9ceecaec24>
Mon, 15 Jul 2019 10:33:21 +0000 (10:33 +0000)
committermagicant <magicant@048f04df-13f5-43d7-8114-9f9ceecaec24>
Mon, 15 Jul 2019 10:33:21 +0000 (10:33 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/yash/yash/trunk@3999 048f04df-13f5-43d7-8114-9f9ceecaec24

NEWS
NEWS.ja
share/completion/rsync
share/completion/ssh

diff --git a/NEWS b/NEWS
index bab7fb6..f37c31c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,8 @@ Yash 2.49
   .  Updated completion scripts:
     *  Remote branch names are now correctly completed for the
        argument to Git remote/fetch/pull/push commands.
+    *  Local pathname operands are now correctly completed for the
+       rsync command.
 
 ----------------------------------------------------------------------
 Yash 2.48
diff --git a/NEWS.ja b/NEWS.ja
index e1b59b8..d8e5a7e 100644 (file)
--- a/NEWS.ja
+++ b/NEWS.ja
@@ -27,6 +27,8 @@ Yash 2.49
   .  補完スクリプトを更新:
     *  Git remote/fetch/pull/push コマンドの引数の補完でリモートの
        ブランチ名が正しく補完されていなかった。
+    *  rsync コマンドの引数の補完でローカルのパス名が正しく補完されて
+       いなかった。
 
 ----------------------------------------------------------------------
 Yash 2.48
index b3a9907..b127946 100644 (file)
@@ -216,6 +216,7 @@ function completion/rsync::operand {
        #TODO support rsync daemon protocol
 
        command -f completion//getoperands
+       WORDS=(rsync "$WORDS")
 
        if command -vf completion/scp::operand >/dev/null 2>&1 ||
                        . -AL completion/ssh; then
index 2da372b..c8a6a47 100644 (file)
@@ -310,7 +310,7 @@ function completion/ssh::completehostname {
 }
 
 function completion/ssh::completeremotepath
-       case $cmd in (scp|sftp)
+       case $cmd in (scp|sftp|rsync)
                PREFIX=${TARGETWORD%"$path"}
                typeset host="${${PREFIX%[/:]}/#${cmd}:\/\//ssh:\/\/}"
                typeset name="${path##*/}"
@@ -334,7 +334,7 @@ function completion/ssh::completeremotepath
        esac
 
 function completion/ssh::completelocalpath
-       case $cmd in (scp)
+       case $cmd in (scp|rsync)
                typeset slash=false
                case $TARGETWORD in (*/*)
                        slash=