Repository navigation
add short command aliases - #1369
chandlerok wants to merge 3 commits into
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
Nice idea — s, ls, rm are natural Unix-style aliases for the most-used commands, and visible_alias keeps them discoverable.
CI is red because the PR only updates src/cli/mod.rs but doesn't update the test artifacts that depend on the help output:
-
Help snapshots — 4 snapshot files need the
[aliases: ...]annotations added. Runcargo insta test --review(orcargo test+cargo insta review) to update them:integration__integration_tests__help__help_root_short.snapintegration__integration_tests__help__help_root_long.snapintegration__integration_tests__help__help_no_args.snapintegration__integration_tests__help__help_md_root.snap
-
Completion test —
test_complete_subcommands_filter_options(attests/integration_tests/completion.rs:962) assertssuggestions.contains(&"switch"). With aliases, clap's completion output format may have changed — worth investigating whether the aliases appear as separate completions or alter the existing entries.
Once the snapshots are regenerated and the completion test is fixed or updated, this should be good to go.
worktrunk-bot
left a comment
There was a problem hiding this comment.
CI is red — 5 completion-related tests are failing because the short aliases changed the completion output but the corresponding snapshots weren't updated:
test_complete_subcommands_filter_optionstest_bash_completion_subcommandstest_fish_completion_subcommandstest_nushell_completion_subcommandstest_zsh_completion_subcommands
This is the completion test concern from the previous review. The help snapshots were updated but the completion snapshots also need regenerating. Running cargo insta test --review with the shell-integration-tests feature should catch all of them:
cargo insta test --review --features shell-integration-testsCI failed — completion snapshots need updating
Closes #1370
Summary
Adds short aliases for the most commonly used
wtsubcommands and flags:Command aliases
wt switchwt swt listwt lswt removewt rmShort args for
switch--branches-B--remotes-rThese use clap's
visible_alias/shortso they show up in--helpoutput, making them discoverable.Motivation
These commands and flags are the most frequently used in day-to-day workflows. Short aliases reduce typing friction —
wt s -Bandwt lsfeel natural for users familiar with Unix conventions (ls,rm).