Skip to content

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

docs(cli): render --format help as terse inline possible-values (#3108)

Maximilian Roos41d5ef7349e1
diff --git a/docs/content/config.md b/docs/content/config.md
index 03362775f..4fa158892 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -631,11 +631,8 @@ Usage: <b><span class=c>wt config show</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>--format</span></b><span class=c> &lt;FORMAT&gt;</span>
Output format (text, json)
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
diff --git a/docs/content/merge.md b/docs/content/merge.md
index 28e4983e6..3382a0f4a 100644
--- a/docs/content/merge.md
+++ b/docs/content/merge.md
@@ -144,11 +144,8 @@ Usage: <b><span class=c>wt merge</span></b> <span class=c>[OPTIONS]</span> <span
JSON prints structured result to stdout after merge completes.
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
diff --git a/docs/content/remove.md b/docs/content/remove.md
index 2d7e4a30e..3d1d0bf94 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -127,11 +127,8 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
JSON prints structured result to stdout after removal completes.
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
diff --git a/docs/content/step.md b/docs/content/step.md
index 3b9b8569b..9daca6e97 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -161,11 +161,8 @@ Usage: <b><span class=c>wt step commit</span></b> <span class=c>[OPTIONS]</span>
JSON prints structured result to stdout after the commit completes.
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
@@ -256,11 +253,8 @@ Usage: <b><span class=c>wt step squash</span></b> <span class=c>[OPTIONS]</span>
JSON prints structured result to stdout after the squash completes.
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
@@ -481,11 +475,8 @@ Usage: <b><span class=c>wt step copy-ignored</span></b> <span class=c>[OPTIONS]<
JSON prints structured result to stdout after the copy completes.
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
@@ -645,11 +636,8 @@ Usage: <b><span class=c>wt step for-each</span></b> <span class=c>[OPTIONS]</spa
<b><span class=c>--format</span></b><span class=c> &lt;FORMAT&gt;</span>
Output format (text, json)
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
@@ -796,11 +784,8 @@ Usage: <b><span class=c>wt step prune</span></b> <span class=c>[OPTIONS]</span>
<b><span class=c>--format</span></b><span class=c> &lt;FORMAT&gt;</span>
Output format (text, json)
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=c>-h</span></b>, <b><span class=c>--help</span></b>
Print help (see a summary with &#39;-h&#39;)
@@ -907,11 +892,8 @@ Usage: <b><span class=c>wt step relocate</span></b> <span class=c>[OPTIONS]</spa
JSON prints structured result to stdout after the relocate completes.
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
diff --git a/docs/content/switch.md b/docs/content/switch.md
index d48920f7a..30f1ec82d 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -205,11 +205,8 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
JSON prints structured result to stdout. Designed for tool integration (e.g., Claude Code
WorktreeCreate hooks).
- Possible values:
- - <b><span class=c>text</span></b>: Human-readable text output
- - <b><span class=c>json</span></b>: JSON output
-
[default: text]
+ [possible values: text, json]
<b><span class=g>Global Options:</span></b>
<b><span class=c>-C</span></b><span class=c> &lt;path&gt;</span>
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index 52c17e5fe..947b54b15 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -632,11 +632,8 @@ Output:
--format <FORMAT>
Output format (text, json)
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
diff --git a/skills/worktrunk/reference/merge.md b/skills/worktrunk/reference/merge.md
index 4744dc5fc..6003a64a8 100644
--- a/skills/worktrunk/reference/merge.md
+++ b/skills/worktrunk/reference/merge.md
@@ -133,11 +133,8 @@ Automation:
JSON prints structured result to stdout after merge completes.
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
diff --git a/skills/worktrunk/reference/remove.md b/skills/worktrunk/reference/remove.md
index 82d5200e4..3994d08fc 100644
--- a/skills/worktrunk/reference/remove.md
+++ b/skills/worktrunk/reference/remove.md
@@ -125,11 +125,8 @@ Automation:
JSON prints structured result to stdout after removal completes.
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index e791829db..7ce881379 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -156,11 +156,8 @@ Automation:
JSON prints structured result to stdout after the commit completes.
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
@@ -255,11 +252,8 @@ Automation:
JSON prints structured result to stdout after the squash completes.
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
@@ -492,11 +486,8 @@ Automation:
JSON prints structured result to stdout after the copy completes.
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
@@ -672,11 +663,8 @@ Options:
--format <FORMAT>
Output format (text, json)
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
-h, --help
Print help (see a summary with '-h')
@@ -833,11 +821,8 @@ Options:
--format <FORMAT>
Output format (text, json)
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
-h, --help
Print help (see a summary with '-h')
@@ -952,11 +937,8 @@ Automation:
JSON prints structured result to stdout after the relocate completes.
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.md
index ac9529813..84d7fc776 100644
--- a/skills/worktrunk/reference/switch.md
+++ b/skills/worktrunk/reference/switch.md
@@ -200,11 +200,8 @@ Automation:
JSON prints structured result to stdout. Designed for tool integration (e.g., Claude Code
WorktreeCreate hooks).
- Possible values:
- - text: Human-readable text output
- - json: JSON output
-
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index c7253bb95..c6a6e3d79 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -179,9 +179,7 @@ pub(crate) fn version_str() -> &'static str {
/// Output format for commands with text + JSON modes (e.g., `wt switch`).
#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)]
pub(crate) enum SwitchFormat {
- /// Human-readable text output
Text,
- /// JSON output
Json,
}
@@ -189,9 +187,7 @@ pub(crate) enum SwitchFormat {
// unrelated codepaths to handle it. Consider a dedicated StatuslineFormat enum.
#[derive(Debug, Clone, Copy, clap::ValueEnum)]
pub(crate) enum OutputFormat {
- /// Human-readable table format
Table,
- /// JSON output
Json,
/// Claude Code statusline mode (reads context from stdin)
#[value(name = "claude-code")]
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_show.snap b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
index eef9847c5..62980a649 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_show.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
@@ -47,12 +47,9 @@ Usage: wt config show [OPTIONS]
Output:
--format <FORMAT>
Output format (text, json)
-
- Possible values:
- - text: Human-readable text output
- - json: JSON output
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index b907406cb..598b40488 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -79,12 +79,9 @@ Automation:
Output format
JSON prints structured result to stdout after merge completes.
-
- Possible values:
- - text: Human-readable text output
- - json: JSON output
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
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 5dd296712..4295bb92e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -79,12 +79,9 @@ Usage: wt merge [OPTIONS] [TARGET]
Output format
JSON prints structured result to stdout after merge completes.
-
- Possible values:
- - text: Human-readable text output
- - json: JSON output
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
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 9870214a9..080c6d3b0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -68,12 +68,9 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Output format
JSON prints structured result to stdout after removal completes.
-
- Possible values:
- - text: Human-readable text output
- - json: JSON output
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>
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 1304723b7..92854ad44 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -98,12 +98,9 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
Output format
JSON prints structured result to stdout. Designed for tool integration (e.g., Claude Code WorktreeCreate hooks).
-
- Possible values:
- - text: Human-readable text output
- - json: JSON output
[default: text]
+ [possible values: text, json]
Global Options:
-C <path>