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

Commit 4f141bc

Browse files
committed
Add a deprecated envs command
There doesn't appear to be a way to deprecate an alias so create a new command instead.
1 parent 24ab3d2 commit 4f141bc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

internal/cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func Make() *cobra.Command {
2828
usersCmd(),
2929
tagsCmd(),
3030
configSSHCmd(),
31+
envCmd(), // DEPRECATED.
3132
workspacesCmd(),
3233
syncCmd(),
3334
urlCmd(),

internal/cmd/workspaces.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,20 @@ import (
2121

2222
const defaultImgTag = "latest"
2323

24+
func envCmd() *cobra.Command {
25+
cmd := workspacesCmd()
26+
cmd.Use = "envs"
27+
cmd.Deprecated = "use \"ws\" instead"
28+
cmd.Aliases = []string{}
29+
return cmd
30+
}
31+
2432
func workspacesCmd() *cobra.Command {
2533
cmd := &cobra.Command{
2634
Use: "ws",
2735
Short: "Interact with Coder workspaces",
2836
Long: "Perform operations on the Coder workspaces owned by the active user.",
29-
Aliases: []string{"envs", "workspaces"},
37+
Aliases: []string{"workspaces"},
3038
}
3139

3240
cmd.AddCommand(

0 commit comments

Comments
 (0)