Skip to content

Commit 5f82c19

Browse files
committed
Minor cleanup
1 parent e7eac12 commit 5f82c19

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set up a relay server.
88

99
## Basic Usage
1010

11+
Install:
1112
```
1213
go install github.com/coder/wush/cmd/wush@latest
1314
```

cmd/wush/receive.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ func logF(format string, args ...any) {
2727
}
2828

2929
func receiveCmd() *serpent.Command {
30-
var (
31-
overlayType string
32-
)
30+
var overlayType string
3331
return &serpent.Command{
3432
Use: "receive",
3533
Handler: func(inv *serpent.Invocation) error {
@@ -62,7 +60,7 @@ func receiveCmd() *serpent.Command {
6260

6361
fmt.Println("Your auth key is:")
6462
fmt.Println("\t>", cliui.Code(r.ClientAuth().AuthKey()))
65-
fmt.Println("Use this key to authenticate other", cliui.Code("wush"), "commands to authenticate to this instance.")
63+
fmt.Println("Use this key to authenticate other", cliui.Code("wush"), "commands to this instance.")
6664

6765
s, err := tsserver.NewServer(ctx, logger, r)
6866
if err != nil {

cmd/wush/rsync.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io"
66
"log/slog"
77
"net/netip"
8+
"os"
89
"os/exec"
910
"strings"
1011

@@ -76,9 +77,10 @@ func rsyncCmd() *serpent.Command {
7677
fmt.Println("\t> Server overlay public key: ", cliui.Code(send.Auth.ReceiverPublicKey.ShortString()))
7778
fmt.Println("\t> Server overlay auth key: ", cliui.Code(send.Auth.OverlayPrivateKey.Public().ShortString()))
7879

80+
progPath := os.Args[0]
7981
args := []string{
8082
"-c",
81-
"rsync --progress --stats -avz --human-readable " + fmt.Sprintf("-e=\"wush --auth-id %s --stdio --\" ", send.Auth.AuthKey()) + strings.Join(inv.Args, " "),
83+
"rsync --progress --stats -avz --human-readable " + fmt.Sprintf("-e=\"%s --auth-id %s --stdio --\" ", progPath, send.Auth.AuthKey()) + strings.Join(inv.Args, " "),
8284
}
8385
fmt.Println("Running: rsync", args)
8486
cmd := exec.CommandContext(ctx, "sh", args...)

cmd/wush/ssh.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ func sshCmd() *serpent.Command {
3737
Handler: func(inv *serpent.Invocation) error {
3838
ctx := inv.Context()
3939
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
40-
4140
if authID == "" {
4241
err := huh.NewInput().
43-
Title("Enter your Auth ID:").
42+
Title("Enter the receiver's Auth ID:").
4443
Value(&authID).
4544
Run()
4645
if err != nil {

0 commit comments

Comments
 (0)