File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -189,13 +189,32 @@ func (r *RootCmd) deleteProxy() *clibase.Cmd {
189
189
cmd := & clibase.Cmd {
190
190
Use : "delete <name|id>" ,
191
191
Short : "Delete a workspace proxy" ,
192
+ Options : clibase.OptionSet {
193
+ cliui .SkipPromptOption (),
194
+ },
192
195
Middleware : clibase .Chain (
193
196
clibase .RequireNArgs (1 ),
194
197
r .InitClient (client ),
195
198
),
196
199
Handler : func (inv * clibase.Invocation ) error {
197
200
ctx := inv .Context ()
198
- err := client .DeleteWorkspaceProxyByName (ctx , inv .Args [0 ])
201
+
202
+ wsproxy , err := client .WorkspaceProxyByName (ctx , inv .Args [0 ])
203
+ if err != nil {
204
+ return xerrors .Errorf ("fetch workspace proxy %q: %w" , inv .Args [0 ], err )
205
+ }
206
+
207
+ // Confirm deletion of the template.
208
+ _ , err = cliui .Prompt (inv , cliui.PromptOptions {
209
+ Text : fmt .Sprintf ("Delete this workspace proxy: %s?" , cliui .DefaultStyles .Code .Render (wsproxy .DisplayName )),
210
+ IsConfirm : true ,
211
+ Default : cliui .ConfirmNo ,
212
+ })
213
+ if err != nil {
214
+ return err
215
+ }
216
+
217
+ err = client .DeleteWorkspaceProxyByName (ctx , inv .Args [0 ])
199
218
if err != nil {
200
219
return xerrors .Errorf ("delete workspace proxy %q: %w" , inv .Args [0 ], err )
201
220
}
You can’t perform that action at this time.
0 commit comments