Skip to content

Commit 0c01671

Browse files
max-sixtyclaude
andauthored
fix(alias): align alias --help guidance with output guidelines (#2447)
The hint emitted on `wt <alias> --help` violated several user-output conventions: it printed to stdout without a symbol or gutter, used backticks around commands and the alias name, and stacked three indented commands as bullets. Replaced with a state-acknowledging info line for the alias name plus a single hint joining the three suggestions via "to X, run Y" semicolons. Commands and the alias name are styled with `<underline>` (dim-safe in hints), and output now goes to stderr where status messages belong. Before: ``` $ wt sw --help \`sw\` is an alias. Inspect with: wt config alias show sw wt config alias dry-run sw Forward \`--help\` to the alias body with \`wt sw -- --help\`. ``` After: ``` $ wt sw --help ○ sw is an alias ↳ To view config, run wt config alias show sw; to preview expansion, run wt config alias dry-run sw; to forward --help to the alias body, run wt sw -- --help ``` > _This was written by Claude Code on behalf of [@max-sixty](https://github.com/max-sixty)._ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 04025e6 commit 0c01671

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/commands/alias.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use worktrunk::config::{
4040
};
4141
use worktrunk::git::Repository;
4242
use worktrunk::styling::{
43-
eprintln, format_with_gutter, info_message, println, progress_message, verbosity,
43+
eprintln, format_with_gutter, hint_message, info_message, progress_message, verbosity,
4444
warning_message,
4545
};
4646

@@ -99,11 +99,12 @@ fn help_flag_requested(args: &[String]) -> bool {
9999
/// inspection path and documents the `--` escape for forwarding `--help` into
100100
/// the alias body.
101101
fn emit_alias_help_hint(name: &str) {
102-
println!(
103-
"`{name}` is an alias. Inspect with:
104-
wt config alias show {name}
105-
wt config alias dry-run {name}
106-
Forward `--help` to the alias body with `wt {name} -- --help`."
102+
eprintln!("{}", info_message(cformat!("<bold>{name}</> is an alias")));
103+
eprintln!(
104+
"{}",
105+
hint_message(cformat!(
106+
"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</>"
107+
))
107108
);
108109
}
109110

tests/snapshots/integration__integration_tests__step_alias__alias_help_flag_prints_hint.snap

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ info:
4242
success: true
4343
exit_code: 0
4444
----- stdout -----
45-
`deploy` is an alias. Inspect with:
46-
wt config alias show deploy
47-
wt config alias dry-run deploy
48-
Forward `--help` to the alias body with `wt deploy -- --help`.
4945

5046
----- stderr -----
47+
○ deploy is an alias
48+
↳ 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

0 commit comments

Comments
 (0)