Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Rename `finish` command to `remove` for clarity
Maximilian Roos34b0f3a12049
diff --git a/README.md b/README.mdindex 0ec004f54..5bfc1eaab 100644--- a/README.md+++ b/README.md@@ -67,12 +67,12 @@ eval "$(wt init oil)"```This single command provides:-- Shell integration for automatic `cd` on `wt switch` and `wt finish`+- Shell integration for automatic `cd` on `wt switch` and `wt remove`- TAB completion for commands, flags, and branch names (Bash, Fish, Zsh, Oil only)### What Gets Completed-- **Subcommands**: `wt <TAB>` → shows `list`, `switch`, `finish`, `push`, `merge`+- **Subcommands**: `wt <TAB>` → shows `list`, `switch`, `remove`, `push`, `merge`- **Flags**: `wt switch --<TAB>` → shows `--create`, `--base`, `--internal`- **Branch names**: `wt switch <TAB>` → shows branches without worktrees- **Target branches**: `wt push <TAB>` → shows all branches@@ -92,16 +92,16 @@ This single command provides:# List all worktreeswt list-# Switch to a worktree (creates if doesn't exist)+# Switch to a worktreewt switch feature-branch-# Finish current worktree and return to primary-wt finish+# Finish current worktree, returning to primary if current+wt remove# Push changes between worktreeswt push target-worktree-# Merge and cleanup+# Merge worktree into target branchwt merge main```@@ -112,7 +112,7 @@ wt merge main# Use a custom prefix instead of 'wt'eval "$(wt init bash --cmd myprefix)"-# Now use: myprefix switch, myprefix finish, etc.+# Now use: myprefix switch, myprefix remove, etc.```**Enable prompt hook:**@@ -191,7 +191,7 @@ wt (Rust binary)│ └── wt merge├── Internal commands (for shell wrapper)│ ├── wt switch --internal → outputs __WORKTRUNK_CD__ directives-│ ├── wt finish --internal → outputs __WORKTRUNK_CD__ directives+│ ├── wt remove --internal → outputs __WORKTRUNK_CD__ directives│ └── wt hook prompt → for prompt integration└── Shell integration└── wt init <shell> → outputs shell wrapper functiondiff --git a/src/main.rs b/src/main.rsindex 46c09ce74..58d9178c2 100644--- a/src/main.rs+++ b/src/main.rs@@ -16,6 +16,7 @@ use worktrunk::shell;#[command(name = "wt")]#[command(about = "Git worktree management", long_about = None)]#[command(version = env!("VERGEN_GIT_DESCRIBE"))]+#[command(disable_help_subcommand = true)]struct Cli {#[command(subcommand)]command: Commands,@@ -40,7 +41,7 @@ enum Commands {/// List all worktreesList,- /// Switch to a worktree (creates if doesn't exist)+ /// Switch to a worktreeSwitch {/// Branch name or worktree pathbranch: String,@@ -58,8 +59,8 @@ enum Commands {internal: bool,},- /// Finish current worktree and return to primary- Finish {+ /// Finish current worktree, returning to primary if current+ Remove {/// Use internal mode (outputs directives for shell wrapper)#[arg(long, hide = true)]internal: bool,@@ -75,12 +76,12 @@ enum Commands {allow_merge_commits: bool,},- /// Merge and cleanup worktree+ /// Merge worktree into target branchMerge {/// Target branch to merge into (defaults to default branch)target: Option<String>,- /// Keep worktree after merging (don't finish)+ /// Keep worktree after merging (don't remove)#[arg(short, long)]keep: bool,},@@ -130,7 +131,7 @@ fn main() {base,internal,} => handle_switch(&branch, create, base.as_deref(), internal),- Commands::Finish { internal } => handle_finish(internal),+ Commands::Remove { internal } => handle_remove(internal),Commands::Push {target,allow_merge_commits,@@ -562,7 +563,7 @@ fn handle_switch(Ok(())}-fn handle_finish(internal: bool) -> Result<(), GitError> {+fn handle_remove(internal: bool) -> Result<(), GitError> {// Check for uncommitted changesif is_dirty()? {return Err(GitError::CommandFailed(@@ -616,7 +617,7 @@ fn handle_finish(internal: bool) -> Result<(), GitError> {if !internal {println!("Moved to primary worktree and removed worktree");println!("Path: {}", primary_worktree_dir.display());- println!("Note: Use 'wt finish' (with shell integration) for automatic cd");+ println!("Note: Use 'wt remove' (with shell integration) for automatic cd");}} else {// In main repo but not on default branch: switch to default@@ -812,7 +813,7 @@ fn handle_merge(target: Option<&str>, keep: bool) -> Result<(), GitError> {.ok_or_else(|| GitError::CommandFailed("Invalid git directory".to_string()))?.to_path_buf();- handle_finish(false)?;+ handle_remove(false)?;// Check if we need to switch to target branchlet new_branch = get_current_branch_in(&primary_worktree_dir)?;diff --git a/templates/bash.sh b/templates/bash.shindex a0b0d94db..de069f5c4 100644--- a/templates/bash.sh+++ b/templates/bash.sh@@ -20,12 +20,12 @@ _wt_exec() {return $exit_code}-# Override {{ cmd_prefix }} command to add --internal flag for switch and finish+# Override {{ cmd_prefix }} command to add --internal flag for switch and remove{{ cmd_prefix }}() {local subcommand="$1"case "$subcommand" in- switch|finish)+ switch|remove)# Commands that need --internal for directory change supportshift_wt_exec "$subcommand" --internal "$@"diff --git a/templates/fish.fish b/templates/fish.fishindex 1fc7322ad..e0c3e6448 100644--- a/templates/fish.fish+++ b/templates/fish.fish@@ -19,12 +19,12 @@ function _wt_execreturn $exit_codeend-# Override {{ cmd_prefix }} command to add --internal flag for switch and finish+# Override {{ cmd_prefix }} command to add --internal flag for switch and removefunction {{ cmd_prefix }}set -l subcommand $argv[1]switch $subcommand- case switch finish+ case switch remove# Commands that need --internal for directory change support_wt_exec $subcommand --internal $argv[2..-1]case '*'diff --git a/tests/integration_tests/completion.rs b/tests/integration_tests/completion.rsindex b74f4bbd1..2d9248d5b 100644--- a/tests/integration_tests/completion.rs+++ b/tests/integration_tests/completion.rs@@ -15,7 +15,7 @@ fn test_completion_command_static() {assert!(stdout.contains("__fish_wt_needs_command"));assert!(stdout.contains("complete -c wt"));assert!(stdout.contains("switch"));- assert!(stdout.contains("finish"));+ assert!(stdout.contains("remove"));assert!(stdout.contains("push"));assert!(stdout.contains("merge"));}@@ -560,11 +560,11 @@ fn test_complete_finish_command_returns_empty() {let temp = TestRepo::new();temp.commit("initial");- // Test completion for finish command (doesn't take arguments)+ // Test completion for remove command (doesn't take arguments)let mut cmd = Command::cargo_bin("wt").unwrap();let output = cmd.current_dir(temp.root_path())- .args(&["complete", "wt", "finish", ""])+ .args(["complete", "wt", "remove", ""]).output().unwrap();diff --git a/tests/integration_tests/directives.rs b/tests/integration_tests/directives.rsindex b4c1b7464..c0bfa4003 100644--- a/tests/integration_tests/directives.rs+++ b/tests/integration_tests/directives.rs@@ -47,9 +47,9 @@ fn test_switch_without_internal() {});}-/// Test finish command with internal flag+/// Test remove command with internal flag#[test]-fn test_finish_internal_directive() {+fn test_remove_internal_directive() {let repo = TestRepo::new();repo.commit("Initial commit");@@ -62,17 +62,17 @@ fn test_finish_internal_directive() {settings.bind(|| {let mut cmd = Command::new(get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);- cmd.arg("finish")+ cmd.arg("remove").arg("--internal").current_dir(repo.root_path());- assert_cmd_snapshot!("finish_internal_directive", cmd);+ assert_cmd_snapshot!("remove_internal_directive", cmd);});}-/// Test finish without internal flag+/// Test remove without internal flag#[test]-fn test_finish_without_internal() {+fn test_remove_without_internal() {let repo = TestRepo::new();repo.commit("Initial commit");@@ -82,8 +82,8 @@ fn test_finish_without_internal() {settings.bind(|| {let mut cmd = Command::new(get_cargo_bin("wt"));repo.clean_cli_env(&mut cmd);- cmd.arg("finish").current_dir(repo.root_path());+ cmd.arg("remove").current_dir(repo.root_path());- assert_cmd_snapshot!("finish_without_internal", cmd);+ assert_cmd_snapshot!("remove_without_internal", cmd);});}diff --git a/tests/integration_tests/e2e_shell.rs b/tests/integration_tests/e2e_shell.rsindex 896e64aa5..ceb2587d2 100644--- a/tests/integration_tests/e2e_shell.rs+++ b/tests/integration_tests/e2e_shell.rs@@ -158,7 +158,7 @@ fn test_e2e_switch_changes_directory(#[case] shell: &str) {#[cfg_attr(feature = "tier-2-integration-tests", case("oil"))]#[cfg_attr(feature = "tier-2-integration-tests", case("powershell"))]#[cfg_attr(feature = "tier-2-integration-tests", case("xonsh"))]-fn test_e2e_finish_returns_to_main(#[case] shell: &str) {+fn test_e2e_remove_returns_to_main(#[case] shell: &str) {let mut repo = TestRepo::new();repo.commit("Initial commit");repo.setup_remote("main");@@ -176,7 +176,7 @@ fn test_e2e_finish_returns_to_main(#[case] shell: &str) {{}{}wt switch --create my-feature- wt finish+ wt removepwd"#,path_export_syntax(shell, &bin_path),@@ -455,7 +455,7 @@ fn test_bash_e2e_multiple_switches() {{}wt switch --create test-branchpwd- wt finish+ wt removepwd"#,get_cargo_bin("wt").parent().unwrap().to_string_lossy(),@@ -471,10 +471,10 @@ fn test_bash_e2e_multiple_switches() {output);- // Should have returned to main (wt finish should work)+ // Should have returned to main (wt remove should work)assert!(output.contains("main"),- "Expected wt finish to work, got: {}",+ "Expected wt remove to work, got: {}",output);}diff --git a/tests/integration_tests/mod.rs b/tests/integration_tests/mod.rsindex 71fdecab6..60b9bed3b 100644--- a/tests/integration_tests/mod.rs+++ b/tests/integration_tests/mod.rs@@ -2,9 +2,9 @@ pub mod completion;pub mod default_branch;pub mod directives;pub mod e2e_shell;-pub mod finish;pub mod init;pub mod list;pub mod merge;pub mod push;+pub mod remove;pub mod switch;diff --git a/tests/integration_tests/finish.rs b/tests/integration_tests/remove.rssimilarity index 71%rename from tests/integration_tests/finish.rsrename to tests/integration_tests/remove.rsindex d00bc0eb8..ff58d277b 100644--- a/tests/integration_tests/finish.rs+++ b/tests/integration_tests/remove.rs@@ -3,26 +3,26 @@ use insta_cmd::assert_cmd_snapshot;use std::process::Command;/// Helper to create snapshot with normalized paths-fn snapshot_finish(test_name: &str, repo: &TestRepo, args: &[&str], cwd: Option<&std::path::Path>) {+fn snapshot_remove(test_name: &str, repo: &TestRepo, args: &[&str], cwd: Option<&std::path::Path>) {let settings = setup_snapshot_settings(repo);settings.bind(|| {- let mut cmd = make_snapshot_cmd(repo, "finish", args, cwd);+ let mut cmd = make_snapshot_cmd(repo, "remove", args, cwd);assert_cmd_snapshot!(test_name, cmd);});}#[test]-fn test_finish_already_on_default() {+fn test_remove_already_on_default() {let mut repo = TestRepo::new();repo.commit("Initial commit");repo.setup_remote("main");// Already on main branch- snapshot_finish("finish_already_on_default", &repo, &[], None);+ snapshot_remove("remove_already_on_default", &repo, &[], None);}#[test]-fn test_finish_switch_to_default() {+fn test_remove_switch_to_default() {let mut repo = TestRepo::new();repo.commit("Initial commit");repo.setup_remote("main");@@ -35,31 +35,31 @@ fn test_finish_switch_to_default() {.output().expect("Failed to create branch");- snapshot_finish("finish_switch_to_default", &repo, &[], None);+ snapshot_remove("remove_switch_to_default", &repo, &[], None);}#[test]-fn test_finish_from_worktree() {+fn test_remove_from_worktree() {let mut repo = TestRepo::new();repo.commit("Initial commit");repo.setup_remote("main");let worktree_path = repo.add_worktree("feature-wt", "feature-wt");- // Run finish from within the worktree- snapshot_finish("finish_from_worktree", &repo, &[], Some(&worktree_path));+ // Run remove from within the worktree+ snapshot_remove("remove_from_worktree", &repo, &[], Some(&worktree_path));}#[test]-fn test_finish_internal_mode() {+fn test_remove_internal_mode() {let mut repo = TestRepo::new();repo.commit("Initial commit");repo.setup_remote("main");let worktree_path = repo.add_worktree("feature-internal", "feature-internal");- snapshot_finish(- "finish_internal_mode",+ snapshot_remove(+ "remove_internal_mode",&repo,&["--internal"],Some(&worktree_path),@@ -67,7 +67,7 @@ fn test_finish_internal_mode() {}#[test]-fn test_finish_dirty_working_tree() {+fn test_remove_dirty_working_tree() {let mut repo = TestRepo::new();repo.commit("Initial commit");repo.setup_remote("main");@@ -76,5 +76,5 @@ fn test_finish_dirty_working_tree() {std::fs::write(repo.root_path().join("dirty.txt"), "uncommitted changes").expect("Failed to create file");- snapshot_finish("finish_dirty_working_tree", &repo, &[], None);+ snapshot_remove("remove_dirty_working_tree", &repo, &[], None);}diff --git a/tests/snapshots/integration__integration_tests__directives__finish_internal_directive.snap b/tests/snapshots/integration__integration_tests__directives__remove_internal_directive.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__directives__finish_internal_directive.snaprename to tests/snapshots/integration__integration_tests__directives__remove_internal_directive.snapdiff --git a/tests/snapshots/integration__integration_tests__directives__finish_without_internal.snap b/tests/snapshots/integration__integration_tests__directives__remove_without_internal.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__directives__finish_without_internal.snaprename to tests/snapshots/integration__integration_tests__directives__remove_without_internal.snapdiff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snapindex a2168c56c..c9ac9fa96 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap@@ -40,12 +40,12 @@ _wt_exec() {return $exit_code}-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removewt() {local subcommand="$1"case "$subcommand" in- switch|finish)+ switch|remove)# Commands that need --internal for directory change supportshift_wt_exec "$subcommand" --internal "$@"@@ -96,12 +96,6 @@ _wt() {wt,completion)cmd="wt__completion";;- wt,finish)- cmd="wt__finish"- ;;- wt,help)- cmd="wt__help"- ;;wt,hook)cmd="wt__hook";;@@ -117,39 +111,12 @@ _wt() {wt,push)cmd="wt__push";;+ wt,remove)+ cmd="wt__remove"+ ;;wt,switch)cmd="wt__switch";;- wt__help,complete)- cmd="wt__help__complete"- ;;- wt__help,completion)- cmd="wt__help__completion"- ;;- wt__help,finish)- cmd="wt__help__finish"- ;;- wt__help,help)- cmd="wt__help__help"- ;;- wt__help,hook)- cmd="wt__help__hook"- ;;- wt__help,init)- cmd="wt__help__init"- ;;- wt__help,list)- cmd="wt__help__list"- ;;- wt__help,merge)- cmd="wt__help__merge"- ;;- wt__help,push)- cmd="wt__help__push"- ;;- wt__help,switch)- cmd="wt__help__switch"- ;;*);;esac@@ -157,7 +124,7 @@ _wt() {case "${cmd}" inwt)- opts="-h -V --help --version init list switch finish push merge hook completion complete help"+ opts="-h -V --help --version init list switch remove push merge hook completion complete"if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; thenCOMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0@@ -198,174 +165,6 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;- wt__finish)- opts="-h --internal --help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help)- opts="init list switch finish push merge hook completion complete help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__complete)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__completion)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__finish)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__help)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__hook)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__init)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__list)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__merge)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__push)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__switch)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;wt__hook)opts="-h --help <HOOK_TYPE>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then@@ -444,6 +243,20 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;+ wt__remove)+ opts="-h --internal --help"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;wt__switch)opts="-c -b -h --create --base --internal --help <BRANCH>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; thendiff --git a/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap b/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snapindex 28ac1c01c..ef58bc592 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash_all_options.snap@@ -44,12 +44,12 @@ _wt_exec() {return $exit_code}-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removewt() {local subcommand="$1"case "$subcommand" in- switch|finish)+ switch|remove)# Commands that need --internal for directory change supportshift_wt_exec "$subcommand" --internal "$@"@@ -113,12 +113,6 @@ _wt() {wt,completion)cmd="wt__completion";;- wt,finish)- cmd="wt__finish"- ;;- wt,help)- cmd="wt__help"- ;;wt,hook)cmd="wt__hook";;@@ -134,39 +128,12 @@ _wt() {wt,push)cmd="wt__push";;+ wt,remove)+ cmd="wt__remove"+ ;;wt,switch)cmd="wt__switch";;- wt__help,complete)- cmd="wt__help__complete"- ;;- wt__help,completion)- cmd="wt__help__completion"- ;;- wt__help,finish)- cmd="wt__help__finish"- ;;- wt__help,help)- cmd="wt__help__help"- ;;- wt__help,hook)- cmd="wt__help__hook"- ;;- wt__help,init)- cmd="wt__help__init"- ;;- wt__help,list)- cmd="wt__help__list"- ;;- wt__help,merge)- cmd="wt__help__merge"- ;;- wt__help,push)- cmd="wt__help__push"- ;;- wt__help,switch)- cmd="wt__help__switch"- ;;*);;esac@@ -174,7 +141,7 @@ _wt() {case "${cmd}" inwt)- opts="-h -V --help --version init list switch finish push merge hook completion complete help"+ opts="-h -V --help --version init list switch remove push merge hook completion complete"if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; thenCOMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0@@ -215,174 +182,6 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;- wt__finish)- opts="-h --internal --help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help)- opts="init list switch finish push merge hook completion complete help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__complete)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__completion)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__finish)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__help)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__hook)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__init)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__list)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__merge)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__push)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__switch)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;wt__hook)opts="-h --help <HOOK_TYPE>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then@@ -461,6 +260,20 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;+ wt__remove)+ opts="-h --internal --help"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;wt__switch)opts="-c -b -h --create --base --internal --help <BRANCH>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; thendiff --git a/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap b/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snapindex f0fd2790d..58f89f3fb 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash_custom_prefix.snap@@ -42,12 +42,12 @@ _wt_exec() {return $exit_code}-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removewt() {local subcommand="$1"case "$subcommand" in- switch|finish)+ switch|remove)# Commands that need --internal for directory change supportshift_wt_exec "$subcommand" --internal "$@"@@ -98,12 +98,6 @@ _wt() {wt,completion)cmd="wt__completion";;- wt,finish)- cmd="wt__finish"- ;;- wt,help)- cmd="wt__help"- ;;wt,hook)cmd="wt__hook";;@@ -119,39 +113,12 @@ _wt() {wt,push)cmd="wt__push";;+ wt,remove)+ cmd="wt__remove"+ ;;wt,switch)cmd="wt__switch";;- wt__help,complete)- cmd="wt__help__complete"- ;;- wt__help,completion)- cmd="wt__help__completion"- ;;- wt__help,finish)- cmd="wt__help__finish"- ;;- wt__help,help)- cmd="wt__help__help"- ;;- wt__help,hook)- cmd="wt__help__hook"- ;;- wt__help,init)- cmd="wt__help__init"- ;;- wt__help,list)- cmd="wt__help__list"- ;;- wt__help,merge)- cmd="wt__help__merge"- ;;- wt__help,push)- cmd="wt__help__push"- ;;- wt__help,switch)- cmd="wt__help__switch"- ;;*);;esac@@ -159,7 +126,7 @@ _wt() {case "${cmd}" inwt)- opts="-h -V --help --version init list switch finish push merge hook completion complete help"+ opts="-h -V --help --version init list switch remove push merge hook completion complete"if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; thenCOMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0@@ -200,174 +167,6 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;- wt__finish)- opts="-h --internal --help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help)- opts="init list switch finish push merge hook completion complete help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__complete)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__completion)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__finish)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__help)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__hook)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__init)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__list)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__merge)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__push)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__switch)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;wt__hook)opts="-h --help <HOOK_TYPE>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then@@ -446,6 +245,20 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;+ wt__remove)+ opts="-h --internal --help"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;wt__switch)opts="-c -b -h --create --base --internal --help <BRANCH>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; thendiff --git a/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap b/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snapindex 81b7e9845..440317f7b 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash_prompt_hook.snap@@ -42,12 +42,12 @@ _wt_exec() {return $exit_code}-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removewt() {local subcommand="$1"case "$subcommand" in- switch|finish)+ switch|remove)# Commands that need --internal for directory change supportshift_wt_exec "$subcommand" --internal "$@"@@ -111,12 +111,6 @@ _wt() {wt,completion)cmd="wt__completion";;- wt,finish)- cmd="wt__finish"- ;;- wt,help)- cmd="wt__help"- ;;wt,hook)cmd="wt__hook";;@@ -132,39 +126,12 @@ _wt() {wt,push)cmd="wt__push";;+ wt,remove)+ cmd="wt__remove"+ ;;wt,switch)cmd="wt__switch";;- wt__help,complete)- cmd="wt__help__complete"- ;;- wt__help,completion)- cmd="wt__help__completion"- ;;- wt__help,finish)- cmd="wt__help__finish"- ;;- wt__help,help)- cmd="wt__help__help"- ;;- wt__help,hook)- cmd="wt__help__hook"- ;;- wt__help,init)- cmd="wt__help__init"- ;;- wt__help,list)- cmd="wt__help__list"- ;;- wt__help,merge)- cmd="wt__help__merge"- ;;- wt__help,push)- cmd="wt__help__push"- ;;- wt__help,switch)- cmd="wt__help__switch"- ;;*);;esac@@ -172,7 +139,7 @@ _wt() {case "${cmd}" inwt)- opts="-h -V --help --version init list switch finish push merge hook completion complete help"+ opts="-h -V --help --version init list switch remove push merge hook completion complete"if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; thenCOMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0@@ -213,174 +180,6 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;- wt__finish)- opts="-h --internal --help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help)- opts="init list switch finish push merge hook completion complete help"- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__complete)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__completion)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__finish)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__help)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__hook)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__init)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__list)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__merge)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__push)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;- wt__help__switch)- opts=""- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- fi- case "${prev}" in- *)- COMPREPLY=()- ;;- esac- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )- return 0- ;;wt__hook)opts="-h --help <HOOK_TYPE>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then@@ -459,6 +258,20 @@ _wt() {COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )return 0;;+ wt__remove)+ opts="-h --internal --help"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;wt__switch)opts="-c -b -h --create --base --internal --help <BRANCH>"if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; thendiff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snapindex b21e558e4..63ba0e1ba 100644--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap@@ -39,12 +39,12 @@ function _wt_execreturn $exit_codeend-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removefunction wtset -l subcommand $argv[1]switch $subcommand- case switch finish+ case switch remove# Commands that need --internal for directory change support_wt_exec $subcommand --internal $argv[2..-1]case '*'@@ -99,11 +99,10 @@ complete -c wt -n "__fish_wt_needs_command" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_needs_command" -s V -l version -d 'Print version'complete -c wt -n "__fish_wt_needs_command" -f -a "init" -d 'Generate shell integration code'complete -c wt -n "__fish_wt_needs_command" -f -a "list" -d 'List all worktrees'-complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree (creates if doesn\'t exist)'-complete -c wt -n "__fish_wt_needs_command" -f -a "finish" -d 'Finish current worktree and return to primary'+complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree'+complete -c wt -n "__fish_wt_needs_command" -f -a "remove" -d 'Finish current worktree, returning to primary if current'complete -c wt -n "__fish_wt_needs_command" -f -a "push" -d 'Push changes between worktrees'-complete -c wt -n "__fish_wt_needs_command" -f -a "merge" -d 'Merge and cleanup worktree'-complete -c wt -n "__fish_wt_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'+complete -c wt -n "__fish_wt_needs_command" -f -a "merge" -d 'Merge worktree into target branch'complete -c wt -n "__fish_wt_using_subcommand init" -l cmd -d 'Command prefix (default: wt)' -rcomplete -c wt -n "__fish_wt_using_subcommand init" -l hook -d 'Hook mode (none, prompt)' -rcomplete -c wt -n "__fish_wt_using_subcommand init" -s h -l help -d 'Print help'@@ -112,21 +111,14 @@ complete -c wt -n "__fish_wt_using_subcommand switch" -s b -l base -d 'Base brancomplete -c wt -n "__fish_wt_using_subcommand switch" -s c -l create -d 'Create a new branch'complete -c wt -n "__fish_wt_using_subcommand switch" -l internal -d 'Use internal mode (outputs directives for shell wrapper)'complete -c wt -n "__fish_wt_using_subcommand switch" -s h -l help -d 'Print help'-complete -c wt -n "__fish_wt_using_subcommand finish" -l internal -d 'Use internal mode (outputs directives for shell wrapper)'-complete -c wt -n "__fish_wt_using_subcommand finish" -s h -l help -d 'Print help'+complete -c wt -n "__fish_wt_using_subcommand remove" -l internal -d 'Use internal mode (outputs directives for shell wrapper)'+complete -c wt -n "__fish_wt_using_subcommand remove" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand push" -l allow-merge-commits -d 'Allow pushing merge commits (non-linear history)'complete -c wt -n "__fish_wt_using_subcommand push" -s h -l help -d 'Print help'-complete -c wt -n "__fish_wt_using_subcommand merge" -s k -l keep -d 'Keep worktree after merging (don\'t finish)'+complete -c wt -n "__fish_wt_using_subcommand merge" -s k -l keep -d 'Keep worktree after merging (don\'t remove)'complete -c wt -n "__fish_wt_using_subcommand merge" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand hook" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand completion" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand complete" -s h -l help -d 'Print help'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "init" -d 'Generate shell integration code'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "list" -d 'List all worktrees'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "switch" -d 'Switch to a worktree (creates if doesn\'t exist)'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "finish" -d 'Finish current worktree and return to primary'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "push" -d 'Push changes between worktrees'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "merge" -d 'Merge and cleanup worktree'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap b/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snapindex 22e679e97..adf878a8c 100644--- a/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap+++ b/tests/snapshots/integration__integration_tests__init__init_fish_prompt_hook.snap@@ -41,12 +41,12 @@ function _wt_execreturn $exit_codeend-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removefunction wtset -l subcommand $argv[1]switch $subcommand- case switch finish+ case switch remove# Commands that need --internal for directory change support_wt_exec $subcommand --internal $argv[2..-1]case '*'@@ -107,11 +107,10 @@ complete -c wt -n "__fish_wt_needs_command" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_needs_command" -s V -l version -d 'Print version'complete -c wt -n "__fish_wt_needs_command" -f -a "init" -d 'Generate shell integration code'complete -c wt -n "__fish_wt_needs_command" -f -a "list" -d 'List all worktrees'-complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree (creates if doesn\'t exist)'-complete -c wt -n "__fish_wt_needs_command" -f -a "finish" -d 'Finish current worktree and return to primary'+complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree'+complete -c wt -n "__fish_wt_needs_command" -f -a "remove" -d 'Finish current worktree, returning to primary if current'complete -c wt -n "__fish_wt_needs_command" -f -a "push" -d 'Push changes between worktrees'-complete -c wt -n "__fish_wt_needs_command" -f -a "merge" -d 'Merge and cleanup worktree'-complete -c wt -n "__fish_wt_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'+complete -c wt -n "__fish_wt_needs_command" -f -a "merge" -d 'Merge worktree into target branch'complete -c wt -n "__fish_wt_using_subcommand init" -l cmd -d 'Command prefix (default: wt)' -rcomplete -c wt -n "__fish_wt_using_subcommand init" -l hook -d 'Hook mode (none, prompt)' -rcomplete -c wt -n "__fish_wt_using_subcommand init" -s h -l help -d 'Print help'@@ -120,21 +119,14 @@ complete -c wt -n "__fish_wt_using_subcommand switch" -s b -l base -d 'Base brancomplete -c wt -n "__fish_wt_using_subcommand switch" -s c -l create -d 'Create a new branch'complete -c wt -n "__fish_wt_using_subcommand switch" -l internal -d 'Use internal mode (outputs directives for shell wrapper)'complete -c wt -n "__fish_wt_using_subcommand switch" -s h -l help -d 'Print help'-complete -c wt -n "__fish_wt_using_subcommand finish" -l internal -d 'Use internal mode (outputs directives for shell wrapper)'-complete -c wt -n "__fish_wt_using_subcommand finish" -s h -l help -d 'Print help'+complete -c wt -n "__fish_wt_using_subcommand remove" -l internal -d 'Use internal mode (outputs directives for shell wrapper)'+complete -c wt -n "__fish_wt_using_subcommand remove" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand push" -l allow-merge-commits -d 'Allow pushing merge commits (non-linear history)'complete -c wt -n "__fish_wt_using_subcommand push" -s h -l help -d 'Print help'-complete -c wt -n "__fish_wt_using_subcommand merge" -s k -l keep -d 'Keep worktree after merging (don\'t finish)'+complete -c wt -n "__fish_wt_using_subcommand merge" -s k -l keep -d 'Keep worktree after merging (don\'t remove)'complete -c wt -n "__fish_wt_using_subcommand merge" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand hook" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand completion" -s h -l help -d 'Print help'complete -c wt -n "__fish_wt_using_subcommand complete" -s h -l help -d 'Print help'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "init" -d 'Generate shell integration code'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "list" -d 'List all worktrees'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "switch" -d 'Switch to a worktree (creates if doesn\'t exist)'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "finish" -d 'Finish current worktree and return to primary'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "push" -d 'Push changes between worktrees'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "merge" -d 'Merge and cleanup worktree'-complete -c wt -n "__fish_wt_using_subcommand help; and not __fish_seen_subcommand_from init list switch finish push merge hook completion complete help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snapindex c9e38e23d..315525412 100644--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap@@ -40,12 +40,12 @@ _wt_exec() {return $exit_code}-# Override wt command to add --internal flag for switch and finish+# Override wt command to add --internal flag for switch and removewt() {local subcommand="$1"case "$subcommand" in- switch|finish)+ switch|remove)# Commands that need --internal for directory change supportshift_wt_exec "$subcommand" --internal "$@"@@ -129,7 +129,7 @@ _arguments "${_arguments_options[@]}" : \':branch -- Branch name or worktree path:_default' \&& ret=0;;-(finish)+(remove)_arguments "${_arguments_options[@]}" : \'--internal[Use internal mode (outputs directives for shell wrapper)]' \'-h[Print help]' \@@ -146,8 +146,8 @@ _arguments "${_arguments_options[@]}" : \;;(merge)_arguments "${_arguments_options[@]}" : \-'-k[Keep worktree after merging (don'\''t finish)]' \-'--keep[Keep worktree after merging (don'\''t finish)]' \+'-k[Keep worktree after merging (don'\''t remove)]' \+'--keep[Keep worktree after merging (don'\''t remove)]' \'-h[Print help]' \'--help[Print help]' \'::target -- Target branch to merge into (defaults to default branch):_default' \@@ -173,62 +173,6 @@ _arguments "${_arguments_options[@]}" : \'--help[Print help]' \'*::args -- Arguments to complete:_default' \&& ret=0-;;-(help)-_arguments "${_arguments_options[@]}" : \-":: :_wt__help_commands" \-"*::: :->help" \-&& ret=0-- case $state in- (help)- words=($line[1] "${words[@]}")- (( CURRENT += 1 ))- curcontext="${curcontext%:*:*}:wt-help-command-$line[1]:"- case $line[1] in- (init)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(list)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(switch)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(finish)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(push)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(merge)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(hook)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(completion)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(complete)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;-(help)-_arguments "${_arguments_options[@]}" : \-&& ret=0-;;- esac- ;;-esac;;esac;;@@ -240,14 +184,13 @@ _wt_commands() {local commands; commands=('init:Generate shell integration code' \'list:List all worktrees' \-'switch:Switch to a worktree (creates if doesn'\''t exist)' \-'finish:Finish current worktree and return to primary' \+'switch:Switch to a worktree' \+'remove:Finish current worktree, returning to primary if current' \'push:Push changes between worktrees' \-'merge:Merge and cleanup worktree' \+'merge:Merge worktree into target branch' \'hook:Hook commands (for shell integration)' \'completion:Generate shell completion script (deprecated - use init instead)' \'complete:Internal completion helper (hidden)' \-'help:Print this message or the help of the given subcommand(s)' \)_describe -t commands 'wt commands' commands "$@"}@@ -261,77 +204,6 @@ _wt__completion_commands() {local commands; commands=()_describe -t commands 'wt completion commands' commands "$@"}-(( $+functions[_wt__finish_commands] )) ||-_wt__finish_commands() {- local commands; commands=()- _describe -t commands 'wt finish commands' commands "$@"-}-(( $+functions[_wt__help_commands] )) ||-_wt__help_commands() {- local commands; commands=(-'init:Generate shell integration code' \-'list:List all worktrees' \-'switch:Switch to a worktree (creates if doesn'\''t exist)' \-'finish:Finish current worktree and return to primary' \-'push:Push changes between worktrees' \-'merge:Merge and cleanup worktree' \-'hook:Hook commands (for shell integration)' \-'completion:Generate shell completion script (deprecated - use init instead)' \-'complete:Internal completion helper (hidden)' \-'help:Print this message or the help of the given subcommand(s)' \- )- _describe -t commands 'wt help commands' commands "$@"-}-(( $+functions[_wt__help__complete_commands] )) ||-_wt__help__complete_commands() {- local commands; commands=()- _describe -t commands 'wt help complete commands' commands "$@"-}-(( $+functions[_wt__help__completion_commands] )) ||-_wt__help__completion_commands() {- local commands; commands=()- _describe -t commands 'wt help completion commands' commands "$@"-}-(( $+functions[_wt__help__finish_commands] )) ||-_wt__help__finish_commands() {- local commands; commands=()- _describe -t commands 'wt help finish commands' commands "$@"-}-(( $+functions[_wt__help__help_commands] )) ||-_wt__help__help_commands() {- local commands; commands=()- _describe -t commands 'wt help help commands' commands "$@"-}-(( $+functions[_wt__help__hook_commands] )) ||-_wt__help__hook_commands() {- local commands; commands=()- _describe -t commands 'wt help hook commands' commands "$@"-}-(( $+functions[_wt__help__init_commands] )) ||-_wt__help__init_commands() {- local commands; commands=()- _describe -t commands 'wt help init commands' commands "$@"-}-(( $+functions[_wt__help__list_commands] )) ||-_wt__help__list_commands() {- local commands; commands=()- _describe -t commands 'wt help list commands' commands "$@"-}-(( $+functions[_wt__help__merge_commands] )) ||-_wt__help__merge_commands() {- local commands; commands=()- _describe -t commands 'wt help merge commands' commands "$@"-}-(( $+functions[_wt__help__push_commands] )) ||-_wt__help__push_commands() {- local commands; commands=()- _describe -t commands 'wt help push commands' commands "$@"-}-(( $+functions[_wt__help__switch_commands] )) ||-_wt__help__switch_commands() {- local commands; commands=()- _describe -t commands 'wt help switch commands' commands "$@"-}(( $+functions[_wt__hook_commands] )) ||_wt__hook_commands() {local commands; commands=()@@ -357,6 +229,11 @@ _wt__push_commands() {local commands; commands=()_describe -t commands 'wt push commands' commands "$@"}+(( $+functions[_wt__remove_commands] )) ||+_wt__remove_commands() {+ local commands; commands=()+ _describe -t commands 'wt remove commands' commands "$@"+}(( $+functions[_wt__switch_commands] )) ||_wt__switch_commands() {local commands; commands=()diff --git a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snapindex 8a0b2b891..d2d3cc650 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_fast_forward.snap@@ -25,6 +25,6 @@ Successfully pushed to 'main'Cleaning up worktree...Moved to primary worktree and removed worktreePath: [REPO]-Note: Use 'wt finish' (with shell integration) for automatic cd+Note: Use 'wt remove' (with shell integration) for automatic cd----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snapindex 8a0b2b891..d2d3cc650 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_not_fast_forward.snap@@ -25,6 +25,6 @@ Successfully pushed to 'main'Cleaning up worktree...Moved to primary worktree and removed worktreePath: [REPO]-Note: Use 'wt finish' (with shell integration) for automatic cd+Note: Use 'wt remove' (with shell integration) for automatic cd----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snapindex a51e934b2..36f2578e6 100644--- a/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap+++ b/tests/snapshots/integration__integration_tests__merge__merge_to_default.snap@@ -24,6 +24,6 @@ Successfully pushed to 'main'Cleaning up worktree...Moved to primary worktree and removed worktreePath: [REPO]-Note: Use 'wt finish' (with shell integration) for automatic cd+Note: Use 'wt remove' (with shell integration) for automatic cd----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__finish__finish_already_on_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__finish__finish_already_on_default.snaprename to tests/snapshots/integration__integration_tests__remove__remove_already_on_default.snapdiff --git a/tests/snapshots/integration__integration_tests__finish__finish_dirty_working_tree.snap b/tests/snapshots/integration__integration_tests__remove__remove_dirty_working_tree.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__finish__finish_dirty_working_tree.snaprename to tests/snapshots/integration__integration_tests__remove__remove_dirty_working_tree.snapdiff --git a/tests/snapshots/integration__integration_tests__finish__finish_from_worktree.snap b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snapsimilarity index 77%rename from tests/snapshots/integration__integration_tests__finish__finish_from_worktree.snaprename to tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snapindex d3ebf652b..7f029d8ab 100644--- a/tests/snapshots/integration__integration_tests__finish__finish_from_worktree.snap+++ b/tests/snapshots/integration__integration_tests__remove__remove_from_worktree.snap@@ -1,9 +1,9 @@----source: tests/integration_tests/finish.rs+source: tests/integration_tests/remove.rsinfo:program: wtargs:- - finish+ - removeenv:GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"@@ -19,6 +19,6 @@ exit_code: 0----- stdout -----Moved to primary worktree and removed worktreePath: [REPO]-Note: Use 'wt finish' (with shell integration) for automatic cd+Note: Use 'wt remove' (with shell integration) for automatic cd----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__finish__finish_internal_mode.snap b/tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__finish__finish_internal_mode.snaprename to tests/snapshots/integration__integration_tests__remove__remove_internal_mode.snapdiff --git a/tests/snapshots/integration__integration_tests__finish__finish_switch_to_default.snap b/tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__finish__finish_switch_to_default.snaprename to tests/snapshots/integration__integration_tests__remove__remove_switch_to_default.snap