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.rsindex 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.snapindex 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: [1m[36mwt merge[0m [36m[OPTIONS][0m [36m[TARGET][0mCommit → Squash → Rebase → Pre-merge hooks → Push → Cleanup → Post-merge hooks-### Commit+[1mCommit[0mUncommitted changes are staged and committed with LLM commit message.Use [2m--stage=tracked[0m to stage only tracked files, or [2m--stage=none[0m to commit only what's already staged.-### Squash+[1mSquash[0mMultiple commits are squashed into one (like GitHub's "Squash and merge") with LLM commit message.Skip with [2m--no-squash[0m. Safety backup: [2mgit reflog show refs/wt-backup/<branch>[0m-### Rebase+[1mRebase[0mBranch is rebased onto target. Conflicts abort the merge immediately.-### Hooks+[1mHooks[0mPre-merge commands run after rebase (failures abort). Post-merge commandsrun after cleanup (failures logged). Skip all with [2m--no-verify[0m.-### Push+[1mPush[0mFast-forward push to local target branch. Non-fast-forward pushes are rejected.-### Cleanup+[1mCleanup[0mWorktree and branch are removed. Skip with [2m--no-remove[0m.diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snapindex 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: [1m[36mwt remove[0m [36m[OPTIONS][0m [36m[WORKTREES]...[0mRemoves worktree directory, git metadata, and branch. Requires clean working tree.-### No arguments (remove current)+[1mNo arguments (remove current)[0m- Removes current worktree and switches to main worktree- In main worktree: switches to default branch-### By name (remove specific)+[1mBy name (remove specific)[0m- Removes specified worktree(s) and branches- Current worktree removed last (switches to main first)-### Worktree resolution+[1mWorktree resolution[0mArguments are resolved to worktrees using [1mpath-first lookup[0m:@@ -83,7 +83,7 @@ branch [2mfoo[0m has a different worktree at [2mrepo.bar/[0m, an error is ra- [2m-[0m - previous worktree (from switch history)- [2m^[0m - main worktree-### Branch deletion+[1mBranch deletion[0mBy 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 presecommit ancestry but do integrate the content. Use [2m-D[0m to delete unintegratedbranches, or [2m--no-delete-branch[0m to always keep branches.-### Background removal (default)+[1mBackground removal (default)[0m- Returns immediately for continued work- Logs: [2m.git/wt-logs/{branch}-remove.log[0m- Use [2m--no-background[0m for foreground (blocking)-### Cleanup+[1mCleanup[0mStops any git fsmonitor daemon for the worktree before removal. This prevents orphaned processes when using builtin fsmonitor ([2mcore.fsmonitor=true[0m). 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.snapindex 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: [1m[36mwt switch[0m [36m[OPTIONS][0m [36m<BRANCH>[0m[32mOperation[0m-### Worktree resolution+[1mWorktree resolution[0mArguments are resolved using [1mpath-first lookup[0m:@@ -72,13 +72,13 @@ Arguments are resolved using [1mpath-first lookup[0m:- [2mwt switch foo[0m switches to [2mrepo.foo/[0m (the [2mbar[0m branch worktree)- [2mwt switch bar[0m also works (falls back to branch lookup)-### Switching to Existing Worktree+[1mSwitching to Existing Worktree[0m- If worktree exists at expected path or for branch, changes directory via shell integration- No hooks run- No branch creation-### Creating New Worktree ([2m--create[0m)+[1mCreating New Worktree (`--create`)[0m1. Creates new branch (defaults to current default branch as base)2. Creates worktree in configured location (default: [2m../{{ main_worktree }}.{{ branch }}[0m)@@ -89,14 +89,14 @@ Arguments are resolved using [1mpath-first lookup[0m:[32mHooks[0m-### post-create (sequential, blocking)+[1mpost-create (sequential, blocking)[0m- Run after worktree creation, before success message- Typically: [2mnpm install[0m, [2mcargo build[0m, setup tasks- Failures block the operation- Skip with [2m--no-verify[0m-### post-start (parallel, background)+[1mpost-start (parallel, background)[0m- Spawned after success message shown- Typically: dev servers, file watchers, editors