Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
docs: improve wt remove help text (#792)
Maximilian Roos1f361b6f455f
diff --git a/.claude-plugin/skills/worktrunk/reference/remove.md b/.claude-plugin/skills/worktrunk/reference/remove.mdindex 7582ab3a6..275c27c4b 100644--- a/.claude-plugin/skills/worktrunk/reference/remove.md+++ b/.claude-plugin/skills/worktrunk/reference/remove.md@@ -1,6 +1,6 @@# wt remove-Remove worktree; delete branch if merged. For finished feature branches. Removes the current worktree by default.+Remove worktree; delete branch if merged. Defaults to the current worktree.## Examples@@ -66,11 +66,15 @@ Without `--force`, removal fails if the worktree contains untracked files. WithoRemoval runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.+## Hooks++`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](https://worktrunk.dev/hook/) for configuration.+## Command referencewt remove - Remove worktree; delete branch if merged-For finished feature branches. Removes the current worktree by default.+Defaults to the current worktree.Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCHES]...</span>diff --git a/docs/content/remove.md b/docs/content/remove.mdindex b1494b97a..e026a1d97 100644--- a/docs/content/remove.md+++ b/docs/content/remove.md@@ -8,7 +8,7 @@ group = "Commands"<!-- ⚠️ AUTO-GENERATED from `wt remove --help-page` — edit cli.rs to update -->-Remove worktree; delete branch if merged. For finished feature branches. Removes the current worktree by default.+Remove worktree; delete branch if merged. Defaults to the current worktree.## Examples@@ -74,6 +74,10 @@ Without `--force`, removal fails if the worktree contains untracked files. WithoRemoval runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.+## Hooks++`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](@/hook.md) for configuration.+## See also- [`wt merge`](@/merge.md) — Remove worktree after merging@@ -84,7 +88,7 @@ Removal runs in the background by default (returns immediately). Logs are writte{% terminal() %}wt remove - Remove worktree; delete branch if merged-For finished feature branches. Removes the current worktree by default.+Defaults to the current worktree.Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <span class=c>[BRANCHES]...</span>diff --git a/src/cli/mod.rs b/src/cli/mod.rsindex 39dc6b31d..2eee0b245 100644--- a/src/cli/mod.rs+++ b/src/cli/mod.rs@@ -682,7 +682,7 @@ Missing a field that would be generally useful? Open an issue at https://github./// Remove worktree; delete branch if merged///- /// For finished feature branches. Removes the current worktree by default.+ /// Defaults to the current worktree.#[command(after_long_help = r#"## ExamplesRemove current worktree:@@ -747,6 +747,10 @@ Without `--force`, removal fails if the worktree contains untracked files. WithoRemoval runs in the background by default (returns immediately). Logs are written to `.git/wt-logs/{branch}-remove.log`. Use `--foreground` to run in the foreground.+## Hooks++`pre-remove` hooks run before the worktree is deleted (with access to worktree files). `post-remove` hooks run after removal. See [`wt hook`](@/hook.md) for configuration.+## See also- [`wt merge`](@/merge.md) — Remove worktree after mergingdiff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snapindex 9eb8e5aeb..06413fe1e 100644--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap@@ -24,7 +24,7 @@ exit_code: 0----- stderr -----wt remove - Remove worktree; delete branch if merged[0m-For finished feature branches. Removes the current worktree by default.[0m+Defaults to the current worktree.[0mUsage: [1m[36mwt remove[0m [36m[OPTIONS][0m [36m[BRANCHES]...[0m@@ -120,6 +120,10 @@ Without [2m--force[0m, removal fails if the worktree contains untracked files.Removal runs in the background by default (returns immediately). Logs are written to [2m.git/wt-logs/{branch}-remove.log[0m. Use [2m--foreground[0m to run in the foreground.+[1m[32mHooks[0m++[2mpre-remove[0m hooks run before the worktree is deleted (with access to worktree files). [2mpost-remove[0m hooks run after removal. See [2mwt hook[0m for configuration.+[1m[32mSee also[0m- [2mwt merge[0m — Remove worktree after merging