Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit ab27899

Browse files
committed
Rework usage and descriptions
1 parent 8f4a73c commit ab27899

File tree

8 files changed

+35
-49
lines changed

8 files changed

+35
-49
lines changed

cmd/coder/configssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ func makeConfigSSHCmd() cli.Command {
2626

2727
return cli.Command{
2828
Name: "config-ssh",
29-
UsageText: "",
30-
Description: "add your Coder Enterprise environments to ~/.ssh/config",
29+
Usage: "Configure SSH to access Coder environments",
30+
Description: "Inject the proper OpenSSH configuration into your local SSH config file.",
3131
Action: configSSH(&configpath, &remove),
3232
Flags: []cli.Flag{
3333
cli.StringFlag{

cmd/coder/envs.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ import (
99
func makeEnvsCommand() cli.Command {
1010
return cli.Command{
1111
Name: "envs",
12-
UsageText: "",
13-
Description: "interact with Coder environments",
12+
Usage: "Interact with Coder environments",
13+
Description: "Perform operations on the Coder environments owned by the active user.",
1414
Subcommands: []cli.Command{
1515
{
1616
Name: "ls",
1717
Usage: "list all environments owned by the active user",
18-
UsageText: "",
19-
Description: "",
18+
Description: "List all Coder environments owned by the active user.",
2019
ArgsUsage: "[...flags]>",
2120
Action: func(c *cli.Context) {
2221
entClient := requireAuth()

cmd/coder/login.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ import (
1616
)
1717

1818
func makeLoginCmd() cli.Command {
19-
cmd := cli.Command{
20-
Name: "login",
21-
Usage: "[Coder Enterprise URL eg. http://my.coder.domain/ ]",
22-
Description: "authenticate this client for future operations",
23-
Action: login,
19+
return cli.Command{
20+
Name: "login",
21+
Usage: "Authenticate this client for future operations",
22+
ArgsUsage: "[Coder Enterprise URL eg. http://my.coder.domain/]",
23+
Action: login,
2424
}
25-
return cmd
2625
}
2726

2827
func login(c *cli.Context) {

cmd/coder/logout.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import (
1111

1212
func makeLogoutCmd() cli.Command {
1313
return cli.Command{
14-
Name: "logout",
15-
//Usage: "",
16-
Description: "remove local authentication credentials (if any)",
17-
Action: logout,
14+
Name: "logout",
15+
Usage: "Remove local authentication credentials if any exist",
16+
Action: logout,
1817
}
1918
}
2019

cmd/coder/secrets.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,26 @@ import (
1717
func makeSecretsCmd() cli.Command {
1818
return cli.Command{
1919
Name: "secrets",
20-
Usage: "",
20+
Usage: "Interact with Coder Secrets",
2121
Description: "Interact with secrets objects owned by the active user.",
2222
Subcommands: []cli.Command{
2323
{
24-
Name: "ls",
25-
Usage: "",
26-
Description: "list all secrets owned by the active user",
27-
Action: listSecrets,
24+
Name: "ls",
25+
Usage: "List all secrets owned by the active user",
26+
Action: listSecrets,
2827
},
2928
makeCreateSecret(),
3029
{
31-
Name: "rm",
32-
Usage: "",
33-
Description: "",
34-
Action: removeSecret,
30+
Name: "rm",
31+
Usage: "Remove a secret by name",
32+
ArgsUsage: "[secret_name]",
33+
Action: removeSecret,
3534
},
3635
{
37-
Name: "view",
38-
Usage: "",
39-
Description: "",
40-
Action: viewSecret,
36+
Name: "view",
37+
Usage: "View a secret by name",
38+
ArgsUsage: "[secret_name]",
39+
Action: viewSecret,
4140
},
4241
},
4342
Flags: nil,
@@ -54,7 +53,7 @@ func makeCreateSecret() cli.Command {
5453

5554
return cli.Command{
5655
Name: "create",
57-
Usage: "create a new secret",
56+
Usage: "Create a new secret",
5857
Description: "Create a new secret object to store application secrets and access them securely from within your environments.",
5958
ArgsUsage: "[secret_name]",
6059
Before: func(c *cli.Context) error {

cmd/coder/shell.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ import (
2222
func makeShellCmd() cli.Command {
2323
return cli.Command{
2424
Name: "sh",
25-
Usage: "<env name> [<command [args...]>]",
26-
Description: "execute a remote command on the environment\\nIf no command is specified, the default shell is opened.",
25+
Usage: "Open a shell and execute commands in a Coder environment",
26+
Description: "Execute a remote command on the environment\\nIf no command is specified, the default shell is opened.",
27+
ArgsUsage: "[env_name] [<command [args...]>]",
2728
SkipFlagParsing: true,
2829
SkipArgReorder: true,
29-
UsageText: "",
30-
ArgsUsage: "",
3130
Action: shell,
3231
}
3332
}

cmd/coder/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func makeSyncCmd() cli.Command {
1919
var init bool
2020
return cli.Command{
2121
Name: "sync",
22-
Usage: "synchronize local files to a Coder environment",
22+
Usage: "Synchronize local files to a Coder environment",
2323
Description: "Establish a one way directory sync to a Coder environment.",
2424
ArgsUsage: "[local directory] [<env name>:<remote directory>]",
2525
Before: func(c *cli.Context) error {

cmd/coder/users.go

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,19 @@ import (
1414
func makeUsersCmd() cli.Command {
1515
var output string
1616
return cli.Command{
17-
Name: "users",
18-
ShortName: "",
19-
Aliases: nil,
20-
Usage: "[subcommand] <flags>",
21-
UsageText: "",
22-
Description: "",
23-
ArgsUsage: "",
24-
Action: nil,
25-
OnUsageError: nil,
17+
Name: "users",
18+
Usage: "Interact with Coder user accounts",
19+
ArgsUsage: "[subcommand] <flags>",
2620
Subcommands: []cli.Command{
2721
{
2822
Name: "ls",
29-
Usage: "",
30-
UsageText: "",
23+
Usage: "list all user accounts",
3124
Description: "",
32-
ArgsUsage: "",
33-
Category: "",
3425
Action: listUsers(&output),
3526
Flags: []cli.Flag{
3627
cli.StringFlag{
3728
Name: "output",
38-
Usage: "",
29+
Usage: "(json | human)",
3930
Required: false,
4031
Value: "human",
4132
Destination: &output,

0 commit comments

Comments
 (0)