Skip to content

Commit 8d9194f

Browse files
nicksenapclaude
andcommitted
Add multi-select to delete command and update gitignore
Allow selecting multiple workspaces for batch deletion in interactive mode, and add .pytest_cache/ and .ruff_cache/ to .gitignore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4b7a09d commit 8d9194f

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ wheels/
88

99
# Virtual environments
1010
.venv
11+
12+
# Tool caches
13+
.pytest_cache/
14+
.ruff_cache/

src/grove/cli.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -318,28 +318,37 @@ def delete(
318318
force: bool = typer.Option(False, "--force", "-f", help="Skip confirmation"),
319319
) -> None:
320320
"""Delete a workspace and its worktrees."""
321-
# Interactive fallback
321+
# Interactive fallback — multi-select
322322
if name is None:
323323
workspaces = state.load_workspaces()
324324
if not workspaces:
325325
error("No workspaces to delete")
326326
raise typer.Exit(1)
327-
name = _pick_one("Select workspace to delete", [ws.name for ws in workspaces])
327+
names = _pick_many("Select workspace(s) to delete", [ws.name for ws in workspaces])
328+
else:
329+
names = [name]
328330

329-
ws = state.get_workspace(name)
330-
if ws is None:
331-
error(f"Workspace [bold]{name}[/] not found")
332-
raise typer.Exit(1)
331+
# Validate all names upfront
332+
for n in names:
333+
if state.get_workspace(n) is None:
334+
error(f"Workspace [bold]{n}[/] not found")
335+
raise typer.Exit(1)
333336

334337
if not force:
335-
confirm = typer.confirm(f"Delete workspace '{name}' and all its worktrees?")
338+
label = ", ".join(names)
339+
msg = f"Delete {len(names)} workspace(s) ({label}) and all their worktrees?"
340+
confirm = typer.confirm(msg)
336341
if not confirm:
337342
info("Cancelled")
338343
return
339344

340-
if workspace.delete_workspace(name):
341-
success(f"Workspace [bold]{name}[/] deleted")
342-
else:
345+
failed = False
346+
for n in names:
347+
if workspace.delete_workspace(n):
348+
success(f"Workspace [bold]{n}[/] deleted")
349+
else:
350+
failed = True
351+
if failed:
343352
raise typer.Exit(1)
344353

345354

0 commit comments

Comments
 (0)