Skip to content

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

Group picker options under separate help heading in wt switch (#1353)

Maximilian Roos9988530bf899
diff --git a/docs/content/switch.md b/docs/content/switch.md
index 1365e80d7..cc7bed3bd 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -176,12 +176,6 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
is expanded for templates, then POSIX shell-escaped.
<b><span class=g>Options:</span></b>
- <b><span class=c>--branches</span></b>
- Include branches without worktrees (interactive picker)
-
- <b><span class=c>--remotes</span></b>
- Include remote branches (interactive picker)
-
<b><span class=c>-c</span></b>, <b><span class=c>--create</span></b>
Create a new branch
@@ -232,6 +226,13 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
+<b><span class=g>Picker Options:</span></b>
+ <b><span class=c>--branches</span></b>
+ Include branches without worktrees
+
+ <b><span class=c>--remotes</span></b>
+ Include remote branches
+
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
Working directory for this command
diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.md
index c39f6cd3a..122927873 100644
--- a/skills/worktrunk/reference/switch.md
+++ b/skills/worktrunk/reference/switch.md
@@ -146,12 +146,6 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
is expanded for templates, then POSIX shell-escaped.
<b><span class=g>Options:</span></b>
- <b><span class=c>--branches</span></b>
- Include branches without worktrees (interactive picker)
-
- <b><span class=c>--remotes</span></b>
- Include remote branches (interactive picker)
-
<b><span class=c>-c</span></b>, <b><span class=c>--create</span></b>
Create a new branch
@@ -202,6 +196,13 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
+<b><span class=g>Picker Options:</span></b>
+ <b><span class=c>--branches</span></b>
+ Include branches without worktrees
+
+ <b><span class=c>--remotes</span></b>
+ Include remote branches
+
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
Working directory for this command
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 46c88832f..e450a6691 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -389,12 +389,12 @@ To change which branch a worktree is on, use `git switch` inside that worktree.
#[arg(add = crate::completion::worktree_branch_completer())]
branch: Option<String>,
- /// Include branches without worktrees (interactive picker)
- #[arg(long, conflicts_with_all = ["create", "base", "execute", "execute_args", "clobber"])]
+ /// Include branches without worktrees
+ #[arg(long, help_heading = "Picker Options", conflicts_with_all = ["create", "base", "execute", "execute_args", "clobber"])]
branches: bool,
- /// Include remote branches (interactive picker)
- #[arg(long, conflicts_with_all = ["create", "base", "execute", "execute_args", "clobber"])]
+ /// Include remote branches
+ #[arg(long, help_heading = "Picker Options", conflicts_with_all = ["create", "base", "execute", "execute_args", "clobber"])]
remotes: bool,
/// Create a new branch
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 a465d4745..8fb9afab6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -47,12 +47,6 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
Arguments after -- are appended to the execute command. Each argument is expanded for templates, then POSIX shell-escaped.
Options:
- --branches
- Include branches without worktrees (interactive picker)
-
- --remotes
- Include remote branches (interactive picker)
-
-c, --create
Create a new branch
@@ -94,6 +88,13 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
-h, --help
Print help (see a summary with '-h')
+Picker Options:
+ --branches
+ Include branches without worktrees
+
+ --remotes
+ Include remote branches
+
Global Options:
-C <path>
Working directory for this command
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
index f5d23502b..032ab19b0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -11,6 +11,7 @@ info:
GIT_EDITOR: ""
LANG: C
LC_ALL: C
+ NO_COLOR: ""
PSModulePath: ""
RUST_LOG: warn
SHELL: ""
@@ -39,8 +40,6 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
[EXECUTE_ARGS]... Additional arguments for --execute command (after --)
Options:
- --branches Include branches without worktrees (interactive picker)
- --remotes Include remote branches (interactive picker)
-c, --create Create a new branch
-b, --base <BASE> Base branch
-x, --execute <EXECUTE> Command to run after switch
@@ -50,6 +49,10 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
--no-verify Skip hooks
-h, --help Print help (see more with '--help')
+Picker Options:
+ --branches Include branches without worktrees
+ --remotes Include remote branches
+
Global Options:
-C <path> Working directory for this command
--config <path> User config file path