Skip to content

Commit 16feaa1

Browse files
committed
golden
1 parent 786f77b commit 16feaa1

File tree

8 files changed

+90
-11
lines changed

8 files changed

+90
-11
lines changed

cli/parameter.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ type workspaceParameterFlags struct {
2424
promptRichParameters bool
2525
}
2626

27+
func (wpf *workspaceParameterFlags) allOptions() []clibase.Option {
28+
options := append(wpf.cliBuildOptions(), wpf.cliParameters()...)
29+
return append(options, wpf.alwaysPrompt())
30+
}
31+
2732
func (wpf *workspaceParameterFlags) cliBuildOptions() []clibase.Option {
2833
return clibase.OptionSet{
2934
{
@@ -54,11 +59,14 @@ func (wpf *workspaceParameterFlags) cliParameters() []clibase.Option {
5459
Description: "Specify a file path with values for rich parameters defined in the template.",
5560
Value: clibase.StringOf(&wpf.richParameterFile),
5661
},
57-
{
58-
Flag: "always-prompt",
59-
Description: "Always prompt all parameters. Does not pull parameter values from existing workspace.",
60-
Value: clibase.BoolOf(&wpf.promptRichParameters),
61-
},
62+
}
63+
}
64+
65+
func (wpf *workspaceParameterFlags) alwaysPrompt() clibase.Option {
66+
return clibase.Option{
67+
Flag: "always-prompt",
68+
Description: "Always prompt all parameters. Does not pull parameter values from existing workspace.",
69+
Value: clibase.BoolOf(&wpf.promptRichParameters),
6270
}
6371
}
6472

cli/restart.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ func (r *RootCmd) restart() *clibase.Cmd {
9393
},
9494
}
9595

96-
cmd.Options = append(cmd.Options, parameterFlags.cliBuildOptions()...)
97-
cmd.Options = append(cmd.Options, parameterFlags.cliParameters()...)
96+
cmd.Options = append(cmd.Options, parameterFlags.allOptions()...)
9897

9998
return cmd
10099
}

cli/start.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ func (r *RootCmd) start() *clibase.Cmd {
6464
},
6565
}
6666

67-
cmd.Options = append(cmd.Options, parameterFlags.cliBuildOptions()...)
68-
cmd.Options = append(cmd.Options, parameterFlags.cliParameters()...)
67+
cmd.Options = append(cmd.Options, parameterFlags.allOptions()...)
6968

7069
return cmd
7170
}

cli/testdata/coder_restart_--help.golden

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ USAGE:
66
Restart a workspace
77

88
OPTIONS:
9+
--always-prompt bool
10+
Always prompt all parameters. Does not pull parameter values from
11+
existing workspace.
12+
913
--build-option string-array, $CODER_BUILD_OPTION
1014
Build option value in the format "name=value".
1115

1216
--build-options bool
1317
Prompt for one-time build options defined with ephemeral parameters.
1418

19+
--parameter string-array, $CODER_RICH_PARAMETER
20+
Rich parameter value in the format "name=value".
21+
22+
--rich-parameter-file string, $CODER_RICH_PARAMETER_FILE
23+
Specify a file path with values for rich parameters defined in the
24+
template.
25+
1526
-y, --yes bool
1627
Bypass prompts.
1728

cli/testdata/coder_start_--help.golden

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ USAGE:
66
Start a workspace
77

88
OPTIONS:
9+
--always-prompt bool
10+
Always prompt all parameters. Does not pull parameter values from
11+
existing workspace.
12+
913
--build-option string-array, $CODER_BUILD_OPTION
1014
Build option value in the format "name=value".
1115

1216
--build-options bool
1317
Prompt for one-time build options defined with ephemeral parameters.
1418

19+
--parameter string-array, $CODER_RICH_PARAMETER
20+
Rich parameter value in the format "name=value".
21+
22+
--rich-parameter-file string, $CODER_RICH_PARAMETER_FILE
23+
Specify a file path with values for rich parameters defined in the
24+
template.
25+
1526
-y, --yes bool
1627
Bypass prompts.
1728

cli/update.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func (r *RootCmd) update() *clibase.Cmd {
5959
},
6060
}
6161

62-
cmd.Options = append(cmd.Options, parameterFlags.cliBuildOptions()...)
63-
cmd.Options = append(cmd.Options, parameterFlags.cliParameters()...)
62+
cmd.Options = append(cmd.Options, parameterFlags.allOptions()...)
6463
return cmd
6564
}

docs/cli/restart.md

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/start.md

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)