Skip to content

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

fix(alias): align alias --help guidance with output guidelines (#2447)

Maximilian Roos0c01671683d8
diff --git a/src/commands/alias.rs b/src/commands/alias.rs
index 4c5fb02d6..9316ea5ba 100644
--- a/src/commands/alias.rs
+++ b/src/commands/alias.rs
@@ -40,7 +40,7 @@ use worktrunk::config::{
};
use worktrunk::git::Repository;
use worktrunk::styling::{
- eprintln, format_with_gutter, info_message, println, progress_message, verbosity,
+ eprintln, format_with_gutter, hint_message, info_message, progress_message, verbosity,
warning_message,
};
@@ -99,11 +99,12 @@ fn help_flag_requested(args: &[String]) -> bool {
/// inspection path and documents the `--` escape for forwarding `--help` into
/// the alias body.
fn emit_alias_help_hint(name: &str) {
- println!(
- "`{name}` is an alias. Inspect with:
- wt config alias show {name}
- wt config alias dry-run {name}
-Forward `--help` to the alias body with `wt {name} -- --help`."
+ eprintln!("{}", info_message(cformat!("<bold>{name}</> is an alias")));
+ eprintln!(
+ "{}",
+ hint_message(cformat!(
+ "To view config, run <underline>wt config alias show {name}</>; to preview expansion, run <underline>wt config alias dry-run {name}</>; to forward --help to the alias body, run <underline>wt {name} -- --help</>"
+ ))
);
}
diff --git a/tests/snapshots/integration__integration_tests__step_alias__alias_help_flag_prints_hint.snap b/tests/snapshots/integration__integration_tests__step_alias__alias_help_flag_prints_hint.snap
index f4fe7d27b..0e3d28b46 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__alias_help_flag_prints_hint.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__alias_help_flag_prints_hint.snap
@@ -42,9 +42,7 @@ info:
success: true
exit_code: 0
----- stdout -----
-`deploy` is an alias. Inspect with:
- wt config alias show deploy
- wt config alias dry-run deploy
-Forward `--help` to the alias body with `wt deploy -- --help`.
----- stderr -----
+○ deploy is an alias
+↳ To view config, run wt config alias show deploy; to preview expansion, run wt config alias dry-run deploy; to forward --help to the alias body, run wt deploy -- --help