Skip to content

Commit 5f817f6

Browse files
committed
rename command
1 parent 5faaa4d commit 5f817f6

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

cli/support.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,26 @@ import (
2121
)
2222

2323
func (r *RootCmd) support() *clibase.Cmd {
24+
supportCmd := &clibase.Cmd{
25+
Use: "support { dump }",
26+
Short: "Commands for troubleshooting issues with a Coder deployment.",
27+
Handler: func(inv *clibase.Invocation) error {
28+
return inv.Command.HelpHandler(inv)
29+
},
30+
Hidden: true, // TODO: un-hide once the must-haves from #12160 are completed.
31+
Children: []*clibase.Cmd{
32+
r.supportBundle(),
33+
},
34+
}
35+
return supportCmd
36+
}
37+
38+
func (r *RootCmd) supportBundle() *clibase.Cmd {
2439
var outputPath string
2540
client := new(codersdk.Client)
2641
cmd := &clibase.Cmd{
27-
Use: "support <workspace> [<agent>]",
28-
Short: "Generate a support bundle to troubleshoot issues.",
42+
Use: "bundle <workspace> [<agent>]",
43+
Short: "Generate a support bundle to troubleshoot issues connecting to a workspace.",
2944
Long: `This command generates a file containing detailed troubleshooting information about the Coder deployment and workspace connections. You must specify a single workspace (and optionally an agent name).`,
3045
Middleware: clibase.Chain(
3146
clibase.RequireRangeArgs(0, 2),
@@ -91,7 +106,6 @@ func (r *RootCmd) support() *clibase.Cmd {
91106
}
92107
return nil
93108
},
94-
Hidden: true, // TODO: un-hide once the must-haves from #12160 are completed.
95109
}
96110
cmd.Options = clibase.OptionSet{
97111
{

cli/support_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"github.com/coder/coder/v2/testutil"
2020
)
2121

22-
func TestSupport(t *testing.T) {
22+
func TestSupportBundle(t *testing.T) {
2323
t.Parallel()
2424

2525
t.Run("Workspace", func(t *testing.T) {
@@ -58,7 +58,7 @@ func TestSupport(t *testing.T) {
5858

5959
d := t.TempDir()
6060
path := filepath.Join(d, "bundle.zip")
61-
inv, root := clitest.New(t, "support", r.Workspace.Name, "--output", path)
61+
inv, root := clitest.New(t, "support", "bundle", r.Workspace.Name, "--output", path)
6262
//nolint: gocritic // requires owner privilege
6363
clitest.SetupConfig(t, client, root)
6464
err = inv.Run()
@@ -70,7 +70,7 @@ func TestSupport(t *testing.T) {
7070
t.Parallel()
7171
client := coderdtest.New(t, nil)
7272
_ = coderdtest.CreateFirstUser(t, client)
73-
inv, root := clitest.New(t, "support")
73+
inv, root := clitest.New(t, "support", "bundle")
7474
//nolint: gocritic // requires owner privilege
7575
clitest.SetupConfig(t, client, root)
7676
err := inv.Run()
@@ -85,7 +85,7 @@ func TestSupport(t *testing.T) {
8585
OrganizationID: admin.OrganizationID,
8686
OwnerID: admin.UserID,
8787
}).Do() // without agent!
88-
inv, root := clitest.New(t, "support", r.Workspace.Name)
88+
inv, root := clitest.New(t, "support", "bundle", r.Workspace.Name)
8989
//nolint: gocritic // requires owner privilege
9090
clitest.SetupConfig(t, client, root)
9191
err := inv.Run()
@@ -101,7 +101,7 @@ func TestSupport(t *testing.T) {
101101
OrganizationID: user.OrganizationID,
102102
OwnerID: member.ID,
103103
}).WithAgent().Do()
104-
inv, root := clitest.New(t, "support", r.Workspace.Name)
104+
inv, root := clitest.New(t, "support", "bundle", r.Workspace.Name)
105105
clitest.SetupConfig(t, memberClient, root)
106106
err := inv.Run()
107107
require.ErrorContains(t, err, "failed authorization check")

0 commit comments

Comments
 (0)