feat: implement organization context in the cli (#12259)

* feat: implement organization context in the cli

`coder org show current`
This commit is contained in:
Steven Masley
2024-02-26 10:03:49 -06:00
committed by GitHub
parent f44c89d200
commit d2998c6b7b
24 changed files with 290 additions and 52 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ func (r *RootCmd) groupCreate() *clibase.Cmd {
Handler: func(inv *clibase.Invocation) error {
ctx := inv.Context()
org, err := agpl.CurrentOrganization(inv, client)
org, err := agpl.CurrentOrganization(&r.RootCmd, inv, client)
if err != nil {
return xerrors.Errorf("current organization: %w", err)
}
+1 -1
View File
@@ -27,7 +27,7 @@ func (r *RootCmd) groupDelete() *clibase.Cmd {
groupName = inv.Args[0]
)
org, err := agpl.CurrentOrganization(inv, client)
org, err := agpl.CurrentOrganization(&r.RootCmd, inv, client)
if err != nil {
return xerrors.Errorf("current organization: %w", err)
}
+1 -1
View File
@@ -37,7 +37,7 @@ func (r *RootCmd) groupEdit() *clibase.Cmd {
groupName = inv.Args[0]
)
org, err := agpl.CurrentOrganization(inv, client)
org, err := agpl.CurrentOrganization(&r.RootCmd, inv, client)
if err != nil {
return xerrors.Errorf("current organization: %w", err)
}
+1 -1
View File
@@ -30,7 +30,7 @@ func (r *RootCmd) groupList() *clibase.Cmd {
Handler: func(inv *clibase.Invocation) error {
ctx := inv.Context()
org, err := agpl.CurrentOrganization(inv, client)
org, err := agpl.CurrentOrganization(&r.RootCmd, inv, client)
if err != nil {
return xerrors.Errorf("current organization: %w", err)
}