Skip to content

Commit 027d47d

Browse files
committed
fix: autostart/autostop: add help and usage, hide for now
1 parent fda43c4 commit 027d47d

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

cli/workspaceautostart.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ import (
1010
"github.com/coder/coder/codersdk"
1111
)
1212

13+
const autostartDescriptionLong = `To have your workspace build automatically at a regular time you can enable autostart.
14+
When enabling autostart, provide a schedule. This schedule is in cron format except only
15+
the following fields are allowed:
16+
- minute
17+
- hour
18+
- day of week
19+
20+
For example, to start your workspace every weekday at 9.30 am, provide the schedule '30 9 1-5'.`
21+
1322
func workspaceAutostart() *cobra.Command {
1423
autostartCmd := &cobra.Command{
15-
Use: "autostart",
24+
Use: "autostart enable <workspace> <schedule>",
25+
Short: "schedule a workspace to automatically start at a regular time",
26+
Long: autostartDescriptionLong,
27+
Example: "coder workspaces autostart enable my-workspace '30 9 1-5'",
28+
Hidden: true, // TODO(cian): un-hide when autostart scheduling implemented
1629
}
1730

1831
autostartCmd.AddCommand(workspaceAutostartEnable())

cli/workspaceautostop.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ import (
1010
"github.com/coder/coder/codersdk"
1111
)
1212

13+
const autostopDescriptionLong = `To have your workspace stop automatically at a regular time you can enable autostop.
14+
When enabling autostop, provide a schedule. This schedule is in cron format except only
15+
the following fields are allowed:
16+
- minute
17+
- hour
18+
- day of week
19+
20+
For example, to stop your workspace every weekday at 5.30 pm, provide the schedule '30 17 1-5'.`
21+
1322
func workspaceAutostop() *cobra.Command {
1423
autostopCmd := &cobra.Command{
15-
Use: "autostop",
24+
Use: "autostop enable <workspace> <schedule>",
25+
Short: "schedule a workspace to automatically start at a regular time",
26+
Long: autostopDescriptionLong,
27+
Example: "coder workspaces autostop enable my-workspace '30 17 1-5'",
28+
Hidden: true, // TODO(cian): un-hide when autostop scheduling implemented
1629
}
1730

1831
autostopCmd.AddCommand(workspaceAutostopEnable())

0 commit comments

Comments
 (0)