Skip to content

Commit 8980fce

Browse files
committed
golden updates
1 parent e8424b2 commit 8980fce

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

cli/create.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (r *RootCmd) create() *clibase.Cmd {
2323
startAt string
2424
stopAfter time.Duration
2525
workspaceName string
26+
buildOptions bool
2627
)
2728
client := new(codersdk.Client)
2829
cmd := &clibase.Cmd{
@@ -123,6 +124,7 @@ func (r *RootCmd) create() *clibase.Cmd {
123124
Template: template,
124125
RichParameterFile: richParameterFile,
125126
NewWorkspaceName: workspaceName,
127+
BuildOptions: buildOptions,
126128
})
127129
if err != nil {
128130
return xerrors.Errorf("prepare build: %w", err)
@@ -189,6 +191,11 @@ func (r *RootCmd) create() *clibase.Cmd {
189191
Description: "Specify a duration after which the workspace should shut down (e.g. 8h).",
190192
Value: clibase.DurationOf(&stopAfter),
191193
},
194+
clibase.Option{
195+
Flag: "build-options",
196+
Description: "Prompt for one-time build options defined with ephemeral parameters.",
197+
Value: clibase.BoolOf(&buildOptions),
198+
},
192199
cliui.SkipPromptOption(),
193200
)
194201

@@ -202,6 +209,7 @@ type prepWorkspaceBuildArgs struct {
202209
NewWorkspaceName string
203210

204211
UpdateWorkspace bool
212+
BuildOptions bool
205213
WorkspaceID uuid.UUID
206214
}
207215

cli/testdata/coder_create_--help.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ Usage: coder create [flags] [name]
33
Create a workspace
44

55
Options
6+
--build-options bool
7+
Prompt for one-time build options defined with ephemeral parameters.
8+
69
--rich-parameter-file string, $CODER_RICH_PARAMETER_FILE
710
Specify a file path with values for rich parameters defined in the
811
template.

cli/testdata/coder_update_--help.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Use --always-prompt to change the parameter values of the workspace.
99
Always prompt all parameters. Does not pull parameter values from
1010
existing workspace.
1111

12+
--build-options bool
13+
Prompt for one-time build options defined with ephemeral parameters.
14+
1215
--rich-parameter-file string, $CODER_RICH_PARAMETER_FILE
1316
Specify a file path with values for rich parameters defined in the
1417
template.

cli/update.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ func (r *RootCmd) update() *clibase.Cmd {
1111
var (
1212
richParameterFile string
1313
alwaysPrompt bool
14+
buildOptions bool
1415
)
1516

1617
client := new(codersdk.Client)
@@ -53,6 +54,8 @@ func (r *RootCmd) update() *clibase.Cmd {
5354

5455
UpdateWorkspace: true,
5556
WorkspaceID: workspace.LatestBuild.ID,
57+
58+
BuildOptions: buildOptions,
5659
})
5760
if err != nil {
5861
return nil
@@ -86,15 +89,19 @@ func (r *RootCmd) update() *clibase.Cmd {
8689
{
8790
Flag: "always-prompt",
8891
Description: "Always prompt all parameters. Does not pull parameter values from existing workspace.",
89-
90-
Value: clibase.BoolOf(&alwaysPrompt),
92+
Value: clibase.BoolOf(&alwaysPrompt),
9193
},
9294
{
9395
Flag: "rich-parameter-file",
9496
Description: "Specify a file path with values for rich parameters defined in the template.",
9597
Env: "CODER_RICH_PARAMETER_FILE",
9698
Value: clibase.StringOf(&richParameterFile),
9799
},
100+
{
101+
Flag: "build-options",
102+
Description: "Prompt for one-time build options defined with ephemeral parameters.",
103+
Value: clibase.BoolOf(&buildOptions),
104+
},
98105
}
99106
return cmd
100107
}

0 commit comments

Comments
 (0)