fix: unify coder create and coder delete help message (#15752)

Closes #15668
This commit is contained in:
Phorcys
2024-12-05 02:32:52 +01:00
committed by GitHub
parent ce573b9faa
commit b5b0a0e746
6 changed files with 21 additions and 3 deletions

View File

@ -39,7 +39,7 @@ func (r *RootCmd) create() *serpent.Command {
client := new(codersdk.Client) client := new(codersdk.Client)
cmd := &serpent.Command{ cmd := &serpent.Command{
Annotations: workspaceCommand, Annotations: workspaceCommand,
Use: "create [name]", Use: "create [workspace]",
Short: "Create a workspace", Short: "Create a workspace",
Long: FormatExamples( Long: FormatExamples(
Example{ Example{

View File

@ -21,6 +21,12 @@ func (r *RootCmd) deleteWorkspace() *serpent.Command {
Annotations: workspaceCommand, Annotations: workspaceCommand,
Use: "delete <workspace>", Use: "delete <workspace>",
Short: "Delete a workspace", Short: "Delete a workspace",
Long: FormatExamples(
Example{
Description: "Delete a workspace for another user (if you have permission)",
Command: "coder delete <username>/<workspace_name>",
},
),
Middleware: serpent.Chain( Middleware: serpent.Chain(
serpent.RequireNArgs(1), serpent.RequireNArgs(1),
r.InitClient(client), r.InitClient(client),

View File

@ -1,7 +1,7 @@
coder v0.0.0-devel coder v0.0.0-devel
USAGE: USAGE:
coder create [flags] [name] coder create [flags] [workspace]
Create a workspace Create a workspace

View File

@ -7,6 +7,10 @@ USAGE:
Aliases: rm Aliases: rm
- Delete a workspace for another user (if you have permission):
$ coder delete <username>/<workspace_name>
OPTIONS: OPTIONS:
--orphan bool --orphan bool
Delete a workspace without deleting its resources. This can delete a Delete a workspace without deleting its resources. This can delete a

View File

@ -7,7 +7,7 @@ Create a workspace
## Usage ## Usage
```console ```console
coder create [flags] [name] coder create [flags] [workspace]
``` ```
## Description ## Description

View File

@ -14,6 +14,14 @@ Aliases:
coder delete [flags] <workspace> coder delete [flags] <workspace>
``` ```
## Description
```console
- Delete a workspace for another user (if you have permission):
$ coder delete <username>/<workspace_name>
```
## Options ## Options
### --orphan ### --orphan