Skip to content

Commit fa83b47

Browse files
committed
fixup example
1 parent a2fcab8 commit fa83b47

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cli/organizationroles.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (r *RootCmd) editOrganizationRole() *serpent.Command {
124124
Long: FormatExamples(
125125
Example{
126126
Description: "Run with an input.json file",
127-
Command: "coder roles edit custom_name < role.json",
127+
Command: "coder roles edit --stdin < role.json",
128128
},
129129
),
130130
Options: []serpent.Option{

enterprise/cli/organization_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
func TestEditOrganizationRoles(t *testing.T) {
1919
t.Parallel()
2020

21+
// Unit test uses --stdin and json as the role input. The interactive cli would
22+
// be hard to drive from a unit test.
2123
t.Run("JSON", func(t *testing.T) {
2224
t.Parallel()
2325

@@ -36,7 +38,6 @@ func TestEditOrganizationRoles(t *testing.T) {
3638

3739
ctx := testutil.Context(t, testutil.WaitMedium)
3840
inv, root := clitest.New(t, "organization", "roles", "edit", "--stdin")
39-
// Use json input, as interactive mode would be challenging to control
4041
inv.Stdin = bytes.NewBufferString(fmt.Sprintf(`{
4142
"name": "new-role",
4243
"organization_id": "%s",

0 commit comments

Comments
 (0)