Skip to content

coder update cli command doesn't explain it needs an arg #3299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spikecurtis opened this issue Jul 29, 2022 · 0 comments · Fixed by #3347
Closed

coder update cli command doesn't explain it needs an arg #3299

spikecurtis opened this issue Jul 29, 2022 · 0 comments · Fixed by #3347
Assignees
Labels
cli Area: CLI

Comments

@spikecurtis
Copy link
Contributor

Problem

% coder update -h
Update a workspace to the latest template version

Usage:
  coder update [flags]

This usage is incorrect, as it needs a workspace name as an arg.

Also, we panic instead of giving an error message when you run it without a workspace name

% coder update
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/coder/coder/cli.update.func1(0x1400079e000, {0x10c681598, 0x0, 0x0?})
	/Users/spike/repos/coder/cli/update.go:28 +0x52c
github.com/spf13/cobra.(*Command).execute(0x1400079e000, {0x10c681598, 0x0, 0x0})
	/Users/spike/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:872 +0x4d0
github.com/spf13/cobra.(*Command).ExecuteC(0x14000720c80)
	/Users/spike/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x354
main.main()
	/Users/spike/repos/coder/cmd/coder/main.go:18 +0xa8

Acceptance criteria

  1. usage should be coder update <workspace> [flags]
  2. running coder update with no args should throw an error (or prompt user for workspace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Area: CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants