Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 08ef03e

Browse files
authored
fix: Optional --name for urls create [ch8011] (#340)
1 parent f2c17d6 commit 08ef03e

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

coder-sdk/devurl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type CreateDevURLReq struct {
4040
Scheme string `json:"scheme"`
4141
}
4242

43-
// CreateDevURL inserts a new devurl for the authenticated user.
43+
// CreateDevURL inserts a new dev URL for the authenticated user.
4444
func (c *DefaultClient) CreateDevURL(ctx context.Context, envID string, req CreateDevURLReq) error {
4545
return c.requestBody(ctx, http.MethodPost, "/api/v0/environments/"+envID+"/devurls", req, nil)
4646
}

docs/coder_urls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Interact with environment DevURLs
1717
### SEE ALSO
1818

1919
* [coder](coder.md) - coder provides a CLI for working with an existing Coder installation
20-
* [coder urls create](coder_urls_create.md) - Create a new devurl for an environment
20+
* [coder urls create](coder_urls_create.md) - Create a new dev URL for a workspace
2121
* [coder urls ls](coder_urls_ls.md) - List all DevURLs for an environment
2222
* [coder urls rm](coder_urls_rm.md) - Remove a dev url
2323

docs/coder_urls_create.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
## coder urls create
22

3-
Create a new devurl for an environment
3+
Create a new dev URL for a workspace
44

55
```
6-
coder urls create [env_name] [port] [flags]
6+
coder urls create [workspace_name] [port] [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
coder urls create my-workspace 8080 --name my-dev-url
713
```
814

915
### Options

internal/cmd/urls.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ func createDevURLCmd() *cobra.Command {
122122
scheme string
123123
)
124124
cmd := &cobra.Command{
125-
Use: "create [env_name] [port]",
126-
Short: "Create a new devurl for an environment",
125+
Use: "create [workspace_name] [port]",
126+
Short: "Create a new dev URL for a workspace",
127127
Aliases: []string{"edit"},
128128
Args: xcobra.ExactArgs(2),
129-
// Run creates or updates a devURL
129+
Example: `coder urls create my-workspace 8080 --name my-dev-url`,
130130
RunE: func(cmd *cobra.Command, args []string) error {
131131
var (
132132
envName = args[0]
@@ -195,8 +195,6 @@ func createDevURLCmd() *cobra.Command {
195195
cmd.Flags().StringVar(&access, "access", "private", "Set DevURL access to [private | org | authed | public]")
196196
cmd.Flags().StringVar(&urlname, "name", "", "DevURL name")
197197
cmd.Flags().StringVar(&scheme, "scheme", "http", "Server scheme (http|https)")
198-
_ = cmd.MarkFlagRequired("name")
199-
200198
return cmd
201199
}
202200

0 commit comments

Comments
 (0)