Skip to content

Commit bb1096b

Browse files
committed
review
1 parent 90897b8 commit bb1096b

File tree

9 files changed

+15
-18
lines changed

9 files changed

+15
-18
lines changed

cli/completion.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,13 @@ func installCompletion(inv *serpent.Invocation, shell completion.Shell) error {
7575
Options: []string{
7676
"Confirm",
7777
"Print to terminal",
78-
"Cancel",
7978
},
8079
Message: fmt.Sprintf("Install completion for %s at %s?", shell.Name(), path),
8180
HideSearch: true,
8281
})
8382
if err != nil {
8483
return err
8584
}
86-
if choice == "Cancel" {
87-
return nil
88-
}
8985
if choice == "Print to terminal" {
9086
return shell.WriteCompletion(inv.Stdout)
9187
}

cli/templateedit.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616

1717
func (r *RootCmd) templateEdit() *serpent.Command {
1818
const deprecatedFlagName = "deprecated"
19-
daysOfWeekEnum := []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"}
2019
var (
2120
name string
2221
displayName string
@@ -241,12 +240,12 @@ func (r *RootCmd) templateEdit() *serpent.Command {
241240
{
242241
Flag: "autostart-requirement-weekdays",
243242
Description: "Edit the template autostart requirement weekdays - workspaces created from this template can only autostart on the given weekdays. To unset this value for the template (and allow autostart on all days), pass 'all'.",
244-
Value: serpent.EnumArrayOf(&autostartRequirementDaysOfWeek, append(daysOfWeekEnum, "all")...),
243+
Value: serpent.EnumArrayOf(&autostartRequirementDaysOfWeek, append(codersdk.AllDaysOfWeek, "all")...),
245244
},
246245
{
247246
Flag: "autostop-requirement-weekdays",
248247
Description: "Edit the template autostop requirement weekdays - workspaces created from this template must be restarted on the given weekdays. To unset this value for the template (and disable the autostop requirement for the template), pass 'none'.",
249-
Value: serpent.EnumArrayOf(&autostopRequirementDaysOfWeek, append(daysOfWeekEnum, "none")...),
248+
Value: serpent.EnumArrayOf(&autostopRequirementDaysOfWeek, append(codersdk.AllDaysOfWeek, "none")...),
250249
},
251250
{
252251
Flag: "autostop-requirement-weeks",

cli/templateversions.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ func (r *RootCmd) templateVersions() *serpent.Command {
4040

4141
func (r *RootCmd) templateVersionsList() *serpent.Command {
4242
defaultColumns := []string{
43-
"Name",
44-
"Created At",
45-
"Created By",
46-
"Status",
47-
"Active",
43+
"name",
44+
"created at",
45+
"created by",
46+
"status",
47+
"active",
4848
}
4949
formatter := cliui.NewOutputFormatter(
5050
cliui.TableFormat([]templateVersionRow{}, defaultColumns),

cli/testdata/coder_templates_versions_list_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ OPTIONS:
99
-O, --org string, $CODER_ORGANIZATION
1010
Select which organization (uuid or name) to use.
1111

12-
-c, --column [name|created at|created by|status|active|archived] (default: Name,Created At,Created By,Status,Active)
12+
-c, --column [name|created at|created by|status|active|archived] (default: name,created at,created by,status,active)
1313
Columns to display in table output.
1414

1515
--include-archived bool

codersdk/templates.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ func BitmapToWeekdays(bitmap uint8) []string {
118118
return days
119119
}
120120

121+
var AllDaysOfWeek = []string{"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"}
122+
121123
type TemplateAutostartRequirement struct {
122124
// DaysOfWeek is a list of days of the week in which autostart is allowed
123125
// to happen. If no days are specified, autostart is not allowed.

docs/reference/cli/features_list.md

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

docs/reference/cli/templates_versions_list.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enterprise/cli/features.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (r *RootCmd) features() *serpent.Command {
3232

3333
func (r *RootCmd) featuresList() *serpent.Command {
3434
var (
35-
featureColumns = []string{"Name", "Entitlement", "Enabled", "Limit", "Actual"}
35+
featureColumns = []string{"name", "entitlement", "enabled", "limit", "actual"}
3636
columns []string
3737
outputFormat string
3838
)

enterprise/cli/testdata/coder_features_list_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ USAGE:
66
Aliases: ls
77

88
OPTIONS:
9-
-c, --column [Name|Entitlement|Enabled|Limit|Actual] (default: Name,Entitlement,Enabled,Limit,Actual)
9+
-c, --column [name|entitlement|enabled|limit|actual] (default: name,entitlement,enabled,limit,actual)
1010
Specify columns to filter in the table.
1111

1212
-o, --output table|json (default: table)

0 commit comments

Comments
 (0)