Skip to content

Commit 738441b

Browse files
committed
CLI changes
1 parent 7d4ad5c commit 738441b

File tree

6 files changed

+55
-10
lines changed

6 files changed

+55
-10
lines changed

cli/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func (r *RootCmd) users() *clibase.Cmd {
1818
r.userList(),
1919
r.userSingle(),
2020
r.createUserStatusCommand(codersdk.UserStatusActive),
21+
r.createUserStatusCommand(codersdk.UserStatusDormant),
2122
r.createUserStatusCommand(codersdk.UserStatusSuspended),
2223
},
2324
}

cli/userstatus.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ func (r *RootCmd) createUserStatusCommand(sdkStatus codersdk.UserStatus) *clibas
2323
pastVerb = "activated"
2424
aliases = []string{"active"}
2525
short = "Update a user's status to 'active'. Active users can fully interact with the platform"
26-
// TODO(mtojek): dormant
26+
case codersdk.UserStatusDormant:
27+
verb = "mark as dormant"
28+
pastVerb = "marked as dormant"
29+
aliases = []string{"dormant"}
30+
// FIXME(mtojek): short = "Update a user's status to 'dormant'. Dormant users are not counted in the license plan"
31+
short = "Update a user's status to 'dormant'."
2732
case codersdk.UserStatusSuspended:
2833
verb = "suspend"
2934
pastVerb = "suspended"
@@ -37,12 +42,12 @@ func (r *RootCmd) createUserStatusCommand(sdkStatus codersdk.UserStatus) *clibas
3742

3843
var columns []string
3944
cmd := &clibase.Cmd{
40-
Use: fmt.Sprintf("%s <username|user_id>", verb),
45+
Use: fmt.Sprintf("%s <username|user_id>", strings.ReplaceAll(verb, " ", "-")),
4146
Short: short,
4247
Aliases: aliases,
4348
Long: formatExamples(
4449
example{
45-
Command: fmt.Sprintf("coder users %s example_user", verb),
50+
Command: fmt.Sprintf("coder users %s example_user", strings.ReplaceAll(verb, " ", "-")),
4651
},
4752
),
4853
Middleware: clibase.Chain(

docs/api/users.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/users.md

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/users_mark-as-dormant.md

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,11 @@
846846
"title": "users list",
847847
"path": "cli/users_list.md"
848848
},
849+
{
850+
"title": "users mark-as-dormant",
851+
"description": "Update a user's status to 'dormant'.",
852+
"path": "cli/users_mark-as-dormant.md"
853+
},
849854
{
850855
"title": "users show",
851856
"description": "Show a single user. Use 'me' to indicate the currently authenticated user.",

0 commit comments

Comments
 (0)