Skip to content

Commit a2e0b42

Browse files
authored
chore: improve consistency of help output (#61)
1 parent cb58cbd commit a2e0b42

File tree

7 files changed

+24
-28
lines changed

7 files changed

+24
-28
lines changed

cmd/wush/cp.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ func cpCmd() *serpent.Command {
133133
)
134134
return &serpent.Command{
135135
Use: "cp <file>",
136-
Short: "Transfer files.",
137-
Long: "Transfer files to a " + cliui.Code("wush") + " peer.\n" + formatExamples(
136+
Short: "Transfer files to a wush server.",
137+
Long: formatExamples(
138138
example{
139-
Description: "Copy a local file to the remote",
139+
Description: "Copy a local file to the server",
140140
Command: "wush cp local-file.txt",
141141
},
142142
),

cmd/wush/main.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ func main() {
1717
var (
1818
showVersion bool
1919

20-
fmtLong = "wush %s - peer-to-peer file transfers and shells\n"
20+
fmtLong = "wush %s - WireGuard-powered peer-to-peer file transfer and shell\n"
2121
)
2222
cmd := &serpent.Command{
2323
Use: "wush <subcommand>",
2424
Long: fmt.Sprintf(fmtLong, getBuildInfo().version) + formatExamples(
2525
example{
26-
Description: "Start the wush server",
26+
Description: "Start the wush server to accept incoming connections",
2727
Command: "wush serve",
2828
},
2929
example{
30-
Description: "Open a shell to the wush host",
30+
Description: "Open a shell to a wush server",
3131
Command: "wush ssh",
3232
},
3333
example{
34-
Description: "Transfer files to the wush host using rsync",
34+
Description: "Transfer files to a wush server with rsync",
3535
Command: "wush rsync local-file.txt :/path/to/remote/file",
3636
},
3737
example{
38-
Description: "Copy a single file to the host",
38+
Description: "Copy a single file to a wush server",
3939
Command: "wush cp local-file.txt",
4040
},
4141
),

cmd/wush/portforward.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ func portForwardCmd() *serpent.Command {
4141
)
4242
return &serpent.Command{
4343
Use: "port-forward",
44-
Short: "Forward TCP or UDP ports",
45-
Long: "Redirect data between local ports and ports on the remote " + cliui.Code("wush") + " peer.\n" + formatExamples(
44+
Short: "Forward ports from the wush server.",
45+
Long: formatExamples(
4646
example{
47-
Description: "Port forward a single TCP port from 1234 in the peer to port 5678 on your local machine",
47+
Description: "Forward a single TCP port from 1234 on the server to port 5678 on your local machine",
4848
Command: "wush port-forward --tcp 5678:1234",
4949
},
5050
example{
51-
Description: "Port forward a single UDP port from port 9000 to port 9000 on your local machine",
51+
Description: "Forward a single UDP port",
5252
Command: "wush port-forward --udp 9000",
5353
},
5454
example{
55-
Description: "Port forward multiple TCP ports and a UDP port",
55+
Description: "Forward multiple TCP ports and a UDP port",
5656
Command: "wush port-forward --tcp 8080:8080 --tcp 9000:3000 --udp 5353:53",
5757
},
5858
example{
59-
Description: "Port forward multiple ports (TCP or UDP) in condensed syntax",
59+
Description: "Forward multiple ports (TCP or UDP) in condensed syntax",
6060
Command: "wush port-forward --tcp 8080,9000:3000,9090-9092,10000-10002:10010-10012",
6161
},
6262
example{
63-
Description: "Port forward specifying the local address to bind to",
63+
Description: "Forward specifying the local address to bind",
6464
Command: "wush port-forward --tcp 1.2.3.4:8080:8080",
6565
},
6666
),

cmd/wush/rsync.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@ func rsyncCmd() *serpent.Command {
2424
)
2525
return &serpent.Command{
2626
Use: "rsync [flags] -- [rsync args]",
27-
Short: "Transfer files over rsync.",
28-
Long: "Runs rsync to transfer files to a " + cliui.Code("wush") + " peer. " +
29-
"Use " + cliui.Code("wush serve") + " on the computer you would like to connect to." +
27+
Short: "Transfer files with rsync to/from a wush server.",
28+
Long: "Use " + cliui.Code("wush serve") + " on the computer you would like to transfer files to." +
3029
"\n\n" +
3130
formatExamples(
3231
example{
33-
Description: "Sync a local file to the remote",
32+
Description: "Upload a local file",
3433
Command: "wush rsync /local/path :/remote/path",
3534
},
3635
example{
37-
Description: "Download a remote file to the local computer",
36+
Description: "Download a remote file",
3837
Command: "wush rsync :/remote/path /local/path",
3938
},
4039
example{

cmd/wush/serve.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ func serveCmd() *serpent.Command {
4444
dm = new(tailcfg.DERPMap)
4545
)
4646
return &serpent.Command{
47-
Use: "serve",
48-
Aliases: []string{"host"},
49-
Short: "Run the wush server.",
50-
Long: "Runs the wush server. Allows other wush CLIs to connect to this computer.",
47+
Use: "serve",
48+
Short: "Run the wush server. Allow wush clients to connect.",
5149
Middleware: serpent.Chain(
5250
derpMap(&derpmapFi, dm),
5351
),

cmd/wush/ssh.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ func sshCmd() *serpent.Command {
3434
return &serpent.Command{
3535
Use: "ssh",
3636
Aliases: []string{},
37-
Short: "Open a shell.",
38-
Long: "Opens an SSH connection to a " + cliui.Code("wush") + " peer. " +
39-
"Use " + cliui.Code("wush serve") + " on the computer you would like to connect to.",
37+
Short: "Open a SSH connection to a wush server.",
38+
Long: "Use " + cliui.Code("wush serve") + " on the computer you would like to connect to.",
4039
Middleware: serpent.Chain(
4140
initLogger(&verbose, &quiet, logger, &logf),
4241
initAuth(&overlayOpts.authKey, &overlayOpts.clientAuth),

cmd/wush/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
func versionCmd() *serpent.Command {
1111
cmd := &serpent.Command{
1212
Use: "version",
13-
Short: "Show wush version.",
13+
Short: "Output the wush version.",
1414
Handler: func(inv *serpent.Invocation) error {
1515
bi := getBuildInfo()
1616
fmt.Printf("Wush %s-%s %s\n", bi.version, bi.commitHash[:7], bi.commitTime.Format(time.RFC1123))

0 commit comments

Comments
 (0)