Skip to content

fix: Group subcommands for cognitive ease #1351

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

Merged
merged 1 commit into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions cli/autostart.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ The default schedule is at 09:00 in your local timezone (TZ env, UTC by default)

func autostart() *cobra.Command {
autostartCmd := &cobra.Command{
Use: "autostart enable <workspace>",
Short: "schedule a workspace to automatically start at a regular time",
Long: autostartDescriptionLong,
Example: "coder autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
Hidden: true,
Annotations: workspaceCommand,
Use: "autostart enable <workspace>",
Short: "schedule a workspace to automatically start at a regular time",
Long: autostartDescriptionLong,
Example: "coder autostart enable my-workspace --minute 30 --hour 9 --days 1-5 --tz Europe/Dublin",
Hidden: true,
}

autostartCmd.AddCommand(autostartEnable())
Expand Down
4 changes: 3 additions & 1 deletion cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ func configSSH() *cobra.Command {
skipProxyCommand bool
)
cmd := &cobra.Command{
Use: "config-ssh",
Annotations: workspaceCommand,
Use: "config-ssh",
Short: "Populate your SSH config with Host entries for all of your workspaces",
RunE: func(cmd *cobra.Command, args []string) error {
client, err := createClient(cmd)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions cli/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ func create() *cobra.Command {
templateName string
)
cmd := &cobra.Command{
Use: "create [name]",
Short: "Create a workspace from a template",
Annotations: workspaceCommand,
Use: "create [name]",
Short: "Create a workspace from a template",
RunE: func(cmd *cobra.Command, args []string) error {
client, err := createClient(cmd)
if err != nil {
Expand Down
8 changes: 5 additions & 3 deletions cli/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import (
// nolint
func delete() *cobra.Command {
return &cobra.Command{
Use: "delete <workspace>",
Aliases: []string{"rm"},
Args: cobra.ExactArgs(1),
Annotations: workspaceCommand,
Use: "delete <workspace>",
Short: "Delete a workspace",
Aliases: []string{"rm"},
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
client, err := createClient(cmd)
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions cli/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import (

func list() *cobra.Command {
return &cobra.Command{
Use: "list",
Aliases: []string{"ls"},
Annotations: workspaceCommand,
Use: "list",
Short: "List all workspaces",
Aliases: []string{"ls"},
RunE: func(cmd *cobra.Command, args []string) error {
client, err := createClient(cmd)
if err != nil {
Expand Down
5 changes: 3 additions & 2 deletions cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ func init() {

func login() *cobra.Command {
return &cobra.Command{
Use: "login <url>",
Args: cobra.ExactArgs(1),
Use: "login <url>",
Short: "Authenticate with a Coder deployment",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
rawURL := args[0]

Expand Down
75 changes: 0 additions & 75 deletions cli/parametercreate.go

This file was deleted.

13 changes: 0 additions & 13 deletions cli/parameterdelete.go

This file was deleted.

50 changes: 0 additions & 50 deletions cli/parameterlist.go

This file was deleted.

78 changes: 0 additions & 78 deletions cli/parameters.go

This file was deleted.

1 change: 1 addition & 0 deletions cli/publickey.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ func publickey() *cobra.Command {
return &cobra.Command{
Use: "publickey",
Aliases: []string{"pubkey"},
Short: "Output your public key for Git operations",
RunE: func(cmd *cobra.Command, args []string) error {
client, err := createClient(cmd)
if err != nil {
Expand Down
Loading