Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
fix: Display command path correctly in help output
Maximilian Roos0820e5221b9d
diff --git a/src/cli.rs b/src/cli.rsindex 3f9e37adb..0a5978b7c 100644--- a/src/cli.rs+++ b/src/cli.rs@@ -66,20 +66,21 @@ Options:/// Build a clap Command for Cli with the shared help template applied recursively.pub fn build_command() -> Command {let cmd = Cli::command();- apply_help_template_recursive(cmd)+ apply_help_template_recursive(cmd, DEFAULT_COMMAND_NAME)}-fn apply_help_template_recursive(mut cmd: Command) -> Command {+fn apply_help_template_recursive(mut cmd: Command, path: &str) -> Command {let template = if cmd.get_subcommands().next().is_some() {HELP_TEMPLATE_WITH_SUBCOMMANDS} else {HELP_TEMPLATE};- cmd = cmd.help_template(template);+ cmd = cmd.help_template(template).display_name(path);for sub in cmd.get_subcommands_mut() {let sub_cmd = std::mem::take(sub);- let sub_cmd = apply_help_template_recursive(sub_cmd);+ let sub_path = format!("{} {}", path, sub_cmd.get_name());+ let sub_cmd = apply_help_template_recursive(sub_cmd, &sub_path);*sub = sub_cmd;}cmddiff --git a/tests/snapshots/integration__integration_tests__help__help_beta.snap b/tests/snapshots/integration__integration_tests__help__help_beta.snapindex c6b6cd89c..b7dc65a54 100644--- a/tests/snapshots/integration__integration_tests__help__help_beta.snap+++ b/tests/snapshots/integration__integration_tests__help__help_beta.snap@@ -13,7 +13,7 @@ info:success: trueexit_code: 0----- stdout ------wt-beta - Development and testing utilities+wt beta - Development and testing utilitiesUsage: wt beta [OPTIONS] <COMMAND>Commands:diff --git a/tests/snapshots/integration__integration_tests__help__help_config.snap b/tests/snapshots/integration__integration_tests__help__help_config.snapindex 3965576a9..d286ceb61 100644--- a/tests/snapshots/integration__integration_tests__help__help_config.snap+++ b/tests/snapshots/integration__integration_tests__help__help_config.snap@@ -13,7 +13,7 @@ info:success: trueexit_code: 0----- stdout ------wt-config - Manage configuration and shell integration+wt config - Manage configuration and shell integrationUsage: wt config [OPTIONS] <COMMAND>Commands:diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell.snapindex 1757fca20..d0e6f7fb1 100644--- a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap+++ b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap@@ -14,7 +14,7 @@ info:success: trueexit_code: 0----- stdout ------wt-config-shell - Shell integration setup+wt config shell - Shell integration setupUsage: wt config shell [OPTIONS] <COMMAND>Commands:diff --git a/tests/snapshots/integration__integration_tests__help__help_list.snap b/tests/snapshots/integration__integration_tests__help__help_list.snapindex 76e9047b5..25d231379 100644--- a/tests/snapshots/integration__integration_tests__help__help_list.snap+++ b/tests/snapshots/integration__integration_tests__help__help_list.snap@@ -13,7 +13,7 @@ info:success: trueexit_code: 0----- stdout ------wt-list - List worktrees and optionally branches+wt list - List worktrees and optionally branchesUsage: wt list [OPTIONS]Options:diff --git a/tests/snapshots/integration__integration_tests__help__help_merge.snap b/tests/snapshots/integration__integration_tests__help__help_merge.snapindex d338485c4..e34ba194e 100644--- a/tests/snapshots/integration__integration_tests__help__help_merge.snap+++ b/tests/snapshots/integration__integration_tests__help__help_merge.snap@@ -13,7 +13,7 @@ info:success: trueexit_code: 0----- stdout ------wt-merge - Merge worktree into target branch+wt merge - Merge worktree into target branchUsage: wt merge [OPTIONS] [TARGET]Options:diff --git a/tests/snapshots/integration__integration_tests__help__help_remove.snap b/tests/snapshots/integration__integration_tests__help__help_remove.snapindex 70b8bcebd..c6b7dbc6e 100644--- a/tests/snapshots/integration__integration_tests__help__help_remove.snap+++ b/tests/snapshots/integration__integration_tests__help__help_remove.snap@@ -13,7 +13,7 @@ info:success: trueexit_code: 0----- stdout ------wt-remove - Remove worktree and branch+wt remove - Remove worktree and branchUsage: wt remove [OPTIONS] [WORKTREES]...Options:diff --git a/tests/snapshots/integration__integration_tests__help__help_switch.snap b/tests/snapshots/integration__integration_tests__help__help_switch.snapindex 3a1308bed..a3649c222 100644--- a/tests/snapshots/integration__integration_tests__help__help_switch.snap+++ b/tests/snapshots/integration__integration_tests__help__help_switch.snap@@ -13,7 +13,7 @@ info:success: trueexit_code: 0----- stdout ------wt-switch - Switch to a worktree+wt switch - Switch to a worktreeUsage: wt switch [OPTIONS] <BRANCH>Options: