Skip to content

Commit 043896a

Browse files
authored
chore: improve help text for configure (#610)
Signed-off-by: Ben McNicholl <[email protected]>
1 parent 18a6543 commit 043896a

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

cmd/configure/configure.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,34 @@ type ConfigureCmd struct {
2222
Add ConfigureAddCmd `cmd:"" optional:"" help:"Add configuration for a new organization"`
2323
}
2424

25-
type ConfigureDefaultCmd struct {
26-
}
25+
type ConfigureDefaultCmd struct{}
2726

28-
type ConfigureAddCmd struct {
29-
}
27+
type ConfigureAddCmd struct{}
3028

3129
func (c *ConfigureAddCmd) Help() string {
32-
return `
30+
return `
3331
Examples:
34-
# Prompt configuration to add for a new organization
32+
# Interactively configure a new organization
3533
$ bk configure add
3634
37-
# Add configure Buildkite API token
38-
$ bk configure add --org my-org --token my-token
35+
# Configure a new organization non-interactively
36+
$ bk configure add --org my-org --token my-token
3937
`
4038
}
4139

4240
func (c *ConfigureCmd) Help() string {
43-
return `
41+
return `
4442
Examples:
4543
# Configure Buildkite API token
4644
$ bk configure --org my-org --token my-token
4745
4846
# Force setting a new token
49-
$ bk configure --force --org my-org --token my-token
47+
$ bk configure --force --org my-org --token my-token
5048
`
5149
}
5250

5351
func (c *ConfigureCmd) Run(kongCtx *kong.Context, globals cli.GlobalFlags) error {
5452
f, err := factory.New()
55-
5653
if err != nil {
5754
return err
5855
}
@@ -69,7 +66,6 @@ func (c *ConfigureCmd) Run(kongCtx *kong.Context, globals cli.GlobalFlags) error
6966
if !c.Force && f.Config.APIToken() != "" {
7067
return errors.New("API token already configured. You must use --force")
7168
}
72-
7369
}
7470

7571
// If flags are provided, use them directly
@@ -96,7 +92,6 @@ func ConfigureRun(f *factory.Factory, org string) error {
9692
if org == "" {
9793
// Get organization slug
9894
inputOrg, err := promptForInput("Organization slug: ", false)
99-
10095
if err != nil {
10196
return err
10297
}

0 commit comments

Comments
 (0)