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

Commit 6a41406

Browse files
committed
fixup! Add completions for env names
1 parent 4752bfc commit 6a41406

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

ci/integration/setup_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"golang.org/x/xerrors"
1414
)
1515

16+
// binpath is populated during package initialization with a path to the coder binary
1617
var binpath string
1718

1819
// initialize integration tests by building the coder-cli binary

cmd/coder/secrets.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ func makeSecretsCmd() *cobra.Command {
2828
},
2929
makeCreateSecret(),
3030
&cobra.Command{
31-
Use: "rm [...secret_name]",
32-
Short: "Remove one or more secrets by name",
33-
Args: cobra.MinimumNArgs(1),
34-
RunE: removeSecrets,
31+
Use: "rm [...secret_name]",
32+
Short: "Remove one or more secrets by name",
33+
Args: cobra.MinimumNArgs(1),
34+
RunE: removeSecrets,
35+
Example: "coder secrets rm mysql-password mysql-user",
3536
},
3637
&cobra.Command{
37-
Use: "view [secret_name]",
38-
Short: "View a secret by name",
39-
Args: cobra.ExactArgs(1),
40-
RunE: viewSecret,
38+
Use: "view [secret_name]",
39+
Short: "View a secret by name",
40+
Args: cobra.ExactArgs(1),
41+
RunE: viewSecret,
42+
Example: "coder secrets view mysql-password",
4143
},
4244
)
4345
return cmd
@@ -55,6 +57,9 @@ func makeCreateSecret() *cobra.Command {
5557
Use: "create [secret_name]",
5658
Short: "Create a new secret",
5759
Long: "Create a new secret object to store application secrets and access them securely from within your environments.",
60+
Example: `coder secrets create mysql-password --from-literal 123password
61+
coder secrets create mysql-password --from-prompt
62+
coder secrets create aws-credentials --from-file ./credentials.json`,
5863
Args: func(cmd *cobra.Command, args []string) error {
5964
if len(args) < 1 {
6065
return xerrors.Errorf("[secret_name] is a required argument")

cmd/coder/shell.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func makeShellCmd() *cobra.Command {
4444
DisableFlagParsing: true,
4545
ValidArgs: getEnvsForCompletion(),
4646
RunE: shell,
47+
Example: "coder sh backend-env",
4748
}
4849
}
4950

cmd/coder/users.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ func makeUsersCmd() *cobra.Command {
1919
lsCmd := &cobra.Command{
2020
Use: "ls",
2121
Short: "list all user accounts",
22-
RunE: listUsers(&outputFmt),
22+
Example: `coder users ls -o json
23+
coder users ls -o json | jq .[] | jq -r .email`,
24+
RunE: listUsers(&outputFmt),
2325
}
24-
lsCmd.Flags().StringVarP(&outputFmt, "output", "0", "human", "human | json")
26+
lsCmd.Flags().StringVarP(&outputFmt, "output", "o", "human", "human | json")
2527

2628
cmd.AddCommand(lsCmd)
2729
return cmd

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy