@@ -38,16 +38,16 @@ func (r *RootCmd) switchOrganization() *clibase.Cmd {
38
38
client := new (codersdk.Client )
39
39
40
40
cmd := & clibase.Cmd {
41
- Use :"switch <organization name | ID>" ,
42
- Short :"Switch the organization used by thecli . Pass an empty string to reset to the default organization." ,
43
- Long :"Switch the organization used by thecli . Pass an empty string to reset to the default organization.\n " + formatExamples (
41
+ Use :"set <organization name | ID>" ,
42
+ Short :"set the organization used by theCLI . Pass an empty string to reset to the default organization." ,
43
+ Long :"set the organization used by theCLI . Pass an empty string to reset to the default organization.\n " + formatExamples (
44
44
example {
45
45
Description :"Remove the current organization and defer to the default." ,
46
- Command :"coder organizationsswitch ''" ,
46
+ Command :"coder organizationsset ''" ,
47
47
},
48
48
example {
49
49
Description :"Switch to a custom organization." ,
50
- Command :"coder organizationsswitch my-org" ,
50
+ Command :"coder organizationsset my-org" ,
51
51
},
52
52
),
53
53
Middleware :clibase .Chain (
@@ -118,7 +118,7 @@ func (r *RootCmd) switchOrganization() *clibase.Cmd {
118
118
var sdkError * codersdk.Error
119
119
if errors .As (err ,& sdkError ) {
120
120
if sdkError .Helper == "" && sdkError .StatusCode ()!= 500 {
121
- sdkError .Helper = `If this error persists, try unsetting your org with 'coder organizationsswitch ""'`
121
+ sdkError .Helper = `If this error persists, try unsetting your org with 'coder organizationsset ""'`
122
122
}
123
123
return sdkError
124
124
}
@@ -167,13 +167,15 @@ func promptUserSelectOrg(inv *clibase.Invocation, conf config.Root, orgs []coder
167
167
defaultOrg = orgs [index ].Name
168
168
}
169
169
170
- const deselectOption = "--Deselect--"
170
+ // deselectOption is the option to delete the organization config file and defer
171
+ // to default behavior.
172
+ const deselectOption = "[Default]"
171
173
if defaultOrg == "" {
172
174
defaultOrg = deselectOption
173
175
}
174
176
175
177
// Pull value from a prompt
176
- _ ,_ = fmt .Fprintln (inv .Stdout ,pretty .Sprint (cliui .DefaultStyles .Wrap ,"Select an organization below toswitch the currentcli context to:" ))
178
+ _ ,_ = fmt .Fprintln (inv .Stdout ,pretty .Sprint (cliui .DefaultStyles .Wrap ,"Select an organization below toset the currentCLI context to:" ))
177
179
value ,err := cliui .Select (inv , cliui.SelectOptions {
178
180
Options :append ([]string {deselectOption },orgNames (orgs )... ),
179
181
Default :defaultOrg ,