@@ -26,9 +26,11 @@ func rsyncCmd() *serpent.Command {
26
26
sshStdio bool
27
27
)
28
28
return & serpent.Command {
29
- Use : "rsync" ,
29
+ Use : "rsync [flags] -- [rsync args] " ,
30
30
Long : "Runs rsync to transfer files to a " + cliui .Code ("wush" ) + " peer. " +
31
- "Use " + cliui .Code ("wush receive" ) + " on the computer you would like to connect to." ,
31
+ "Use " + cliui .Code ("wush receive" ) + " on the computer you would like to connect to." +
32
+ "\n \n " +
33
+ "Example: " + "wush rsync -- --progress --stats -avz --human-readable /local/path :/remote/path" ,
32
34
Handler : func (inv * serpent.Invocation ) error {
33
35
ctx := inv .Context ()
34
36
logger := slog .New (slog .NewTextHandler (io .Discard , nil ))
@@ -79,11 +81,11 @@ func rsyncCmd() *serpent.Command {
79
81
80
82
progPath := os .Args [0 ]
81
83
args := []string {
82
- "-c" ,
83
- "rsync --progress --stats -avz --human-readable " + fmt .Sprintf ("-e=\" %s --auth-id %s --stdio --\" " , progPath , send .Auth .AuthKey ()) + strings .Join (inv .Args , " " ),
84
+ "-e" , fmt .Sprintf ("%s --auth-id %s --stdio --" , progPath , send .Auth .AuthKey ()),
84
85
}
85
- fmt .Println ("Running: rsync" , args )
86
- cmd := exec .CommandContext (ctx , "sh" , args ... )
86
+ args = append (args , inv .Args ... )
87
+ fmt .Println ("Running: rsync" , strings .Join (args , " " ))
88
+ cmd := exec .CommandContext (ctx , "rsync" , args ... )
87
89
cmd .Stdin = inv .Stdin
88
90
cmd .Stdout = inv .Stdout
89
91
cmd .Stderr = inv .Stderr
0 commit comments