diff --git a/cli/testdata/coder_--help.golden b/cli/testdata/coder_--help.golden index 6881d4320f098..915c8362f01b8 100644 --- a/cli/testdata/coder_--help.golden +++ b/cli/testdata/coder_--help.golden @@ -45,7 +45,7 @@ Workspace Commands: ssh Start a shell into a workspace start Start a workspace stop Stop a workspace - update Update a workspace + update Will update and start a given workspace if it is out of date. Flags: --global-config coder Path to the global coder config directory. diff --git a/cli/testdata/coder_update_--help.golden b/cli/testdata/coder_update_--help.golden index 85ae220fdd5c1..d6e4ab61e0730 100644 --- a/cli/testdata/coder_update_--help.golden +++ b/cli/testdata/coder_update_--help.golden @@ -1,4 +1,4 @@ -Update a workspace +Will update and start a given workspace if it is out of date. Use --always-prompt to change the parameter values of the workspace. Usage: coder update [flags] diff --git a/cli/update.go b/cli/update.go index 9e23ee73569dd..4e25893119374 100644 --- a/cli/update.go +++ b/cli/update.go @@ -20,7 +20,9 @@ func update() *cobra.Command { Annotations: workspaceCommand, Use: "update ", Args: cobra.ExactArgs(1), - Short: "Update a workspace", + Short: "Will update and start a given workspace if it is out of date.", + Long: "Will update and start a given workspace if it is out of date. Use --always-prompt to change " + + "the parameter values of the workspace.", RunE: func(cmd *cobra.Command, args []string) error { client, err := CreateClient(cmd) if err != nil { @@ -68,7 +70,7 @@ func update() *cobra.Command { build, err := client.CreateWorkspaceBuild(cmd.Context(), workspace.ID, codersdk.CreateWorkspaceBuildRequest{ TemplateVersionID: template.ActiveVersionID, - Transition: workspace.LatestBuild.Transition, + Transition: codersdk.WorkspaceTransitionStart, ParameterValues: buildParams.parameters, RichParameterValues: buildParams.richParameters, }) diff --git a/docs/cli.md b/docs/cli.md index 0c749c3de21a9..45e25013cf4e1 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -50,6 +50,6 @@ coder [flags] | [stop](./cli/coder_stop) | Stop a workspace | | [templates](./cli/coder_templates) | Manage templates | | [tokens](./cli/coder_tokens) | Manage personal access tokens | -| [update](./cli/coder_update) | Update a workspace | +| [update](./cli/coder_update) | Will update and start a given workspace if it is out of date. | | [users](./cli/coder_users) | Manage users | | [version](./cli/coder_version) | Show coder version | diff --git a/docs/cli/coder_update.md b/docs/cli/coder_update.md index f398650cae592..92da1c1c291e5 100644 --- a/docs/cli/coder_update.md +++ b/docs/cli/coder_update.md @@ -2,7 +2,7 @@ # coder update -Update a workspace +Will update and start a given workspace if it is out of date. Use --always-prompt to change the parameter values of the workspace. ## Usage