Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Help text: Render level 3 headings as bold to differentiate from section headers

Maximilian Roos31023f4bd911
diff --git a/src/md_help.rs b/src/md_help.rs
index bd7f3dcd2..0de2021e0 100644
--- a/src/md_help.rs
+++ b/src/md_help.rs
@@ -27,7 +27,11 @@ pub fn render_markdown_in_help(help: &str) -> String {
}
// Outside code blocks, render markdown headers
- if let Some(header_text) = trimmed.strip_prefix("## ") {
+ if let Some(header_text) = trimmed.strip_prefix("### ") {
+ // Subheadings: bold (differentiated from green ## section headers)
+ let bold = Style::new().bold();
+ result.push_str(&format!("{bold}{header_text}{bold:#}\n"));
+ } else if let Some(header_text) = trimmed.strip_prefix("## ") {
result.push_str(&format!("{green}{header_text}{green:#}\n"));
} else if let Some(header_text) = trimmed.strip_prefix("# ") {
result.push_str(&format!("{green}{header_text}{green:#}\n"));
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index d9dbc99fe..6a30bd1d3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -67,30 +67,30 @@ Usage: wt merge [OPTIONS] [TARGET]
Commit → Squash → Rebase → Pre-merge hooks → Push → Cleanup → Post-merge hooks
-### Commit
+Commit
Uncommitted changes are staged and committed with LLM commit message.
Use --stage=tracked to stage only tracked files, or --stage=none to commit only what's already staged.
-### Squash
+Squash
Multiple commits are squashed into one (like GitHub's "Squash and merge") with LLM commit message.
Skip with --no-squash. Safety backup: git reflog show refs/wt-backup/<branch>
-### Rebase
+Rebase
Branch is rebased onto target. Conflicts abort the merge immediately.
-### Hooks
+Hooks
Pre-merge commands run after rebase (failures abort). Post-merge commands
run after cleanup (failures logged). Skip all with --no-verify.
-### Push
+Push
Fast-forward push to local target branch. Non-fast-forward pushes are rejected.
-### Cleanup
+Cleanup
Worktree and branch are removed. Skip with --no-remove.
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index 92cf5ccd0..496689bf1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -51,17 +51,17 @@ Usage: wt remove [OPTIONS] [WORKTREES]...
Removes worktree directory, git metadata, and branch. Requires clean working tree.
-### No arguments (remove current)
+No arguments (remove current)
- Removes current worktree and switches to main worktree
- In main worktree: switches to default branch
-### By name (remove specific)
+By name (remove specific)
- Removes specified worktree(s) and branches
- Current worktree removed last (switches to main first)
-### Worktree resolution
+Worktree resolution
Arguments are resolved to worktrees using path-first lookup:
@@ -83,7 +83,7 @@ branch foo has a different worktree at repo.bar/, an error is ra
- - - previous worktree (from switch history)
- ^ - main worktree
-### Branch deletion
+Branch deletion
By default, branches are deleted only when their content is already in the target branch:
@@ -96,13 +96,13 @@ This handles workflows where PRs are squash-merged or rebased, which don't prese
commit ancestry but do integrate the content. Use -D to delete unintegrated
branches, or --no-delete-branch to always keep branches.
-### Background removal (default)
+Background removal (default)
- Returns immediately for continued work
- Logs: .git/wt-logs/{branch}-remove.log
- Use --no-background for foreground (blocking)
-### Cleanup
+Cleanup
Stops any git fsmonitor daemon for the worktree before removal. This prevents orphaned processes when using builtin fsmonitor (core.fsmonitor=true). No effect on Watchman users.
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 0477f6359..013e32193 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -59,7 +59,7 @@ Usage: wt switch [OPTIONS] <BRANCH>
Operation
-### Worktree resolution
+Worktree resolution
Arguments are resolved using path-first lookup:
@@ -72,13 +72,13 @@ Arguments are resolved using path-first lookup:
- wt switch foo switches to repo.foo/ (the bar branch worktree)
- wt switch bar also works (falls back to branch lookup)
-### Switching to Existing Worktree
+Switching to Existing Worktree
- If worktree exists at expected path or for branch, changes directory via shell integration
- No hooks run
- No branch creation
-### Creating New Worktree (--create)
+Creating New Worktree (`--create`)
1. Creates new branch (defaults to current default branch as base)
2. Creates worktree in configured location (default: ../{{ main_worktree }}.{{ branch }})
@@ -89,14 +89,14 @@ Arguments are resolved using path-first lookup:
Hooks
-### post-create (sequential, blocking)
+post-create (sequential, blocking)
- Run after worktree creation, before success message
- Typically: npm install, cargo build, setup tasks
- Failures block the operation
- Skip with --no-verify
-### post-start (parallel, background)
+post-start (parallel, background)
- Spawned after success message shown
- Typically: dev servers, file watchers, editors