Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Upgrade dependencies to their latest versions
Maximilian Roos8bdf9d6d5911
diff --git a/Cargo.lock b/Cargo.lockindex 406a3e0e2..c7a96a50d 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -231,9 +231,9 @@ dependencies = [[[package]]name = "clap"-version = "4.5.49"+version = "4.5.50"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f4512b90fa68d3a9932cea5184017c5d200f5921df706d45e853537dea51508f"+checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623"dependencies = ["clap_builder","clap_derive",@@ -241,9 +241,9 @@ dependencies = [[[package]]name = "clap_builder"-version = "4.5.49"+version = "4.5.50"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0025e98baa12e766c67ba13ff4695a887a1eba19569aad00a472546795bd6730"+checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0"dependencies = ["anstream","anstyle",@@ -299,7 +299,7 @@ dependencies = ["serde-untagged","serde_core","serde_json",- "toml 0.9.8",+ "toml","winnow","yaml-rust2",]@@ -356,25 +356,22 @@ dependencies = [[[package]]name = "criterion"-version = "0.5.1"+version = "0.7.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f"+checksum = "e1c047a62b0cc3e145fa84415a3191f628e980b194c2755aa12300a4e6cbd928"dependencies = ["anes","cast","ciborium","clap","criterion-plot",- "is-terminal","itertools","num-traits",- "once_cell","oorandom","plotters","rayon","regex","serde",- "serde_derive","serde_json","tinytemplate","walkdir",@@ -382,9 +379,9 @@ dependencies = [[[package]]name = "criterion-plot"-version = "0.5.0"+version = "0.6.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1"+checksum = "9b1bcc0dc7dfae599d84ad0b1a55f80cde8af3725da8313b528da95ef783e338"dependencies = ["cast","itertools",@@ -624,54 +621,12 @@ version = "0.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"-[[package]]-name = "futures"-version = "0.3.31"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"-dependencies = [- "futures-channel",- "futures-core",- "futures-executor",- "futures-io",- "futures-sink",- "futures-task",- "futures-util",-]--[[package]]-name = "futures-channel"-version = "0.3.31"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"-dependencies = [- "futures-core",- "futures-sink",-]-[[package]]name = "futures-core"version = "0.3.31"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"-[[package]]-name = "futures-executor"-version = "0.3.31"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"-dependencies = [- "futures-core",- "futures-task",- "futures-util",-]--[[package]]-name = "futures-io"-version = "0.3.31"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"-[[package]]name = "futures-macro"version = "0.3.31"@@ -683,12 +638,6 @@ dependencies = ["syn",]-[[package]]-name = "futures-sink"-version = "0.3.31"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"-[[package]]name = "futures-task"version = "0.3.31"@@ -707,13 +656,9 @@ version = "0.3.31"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"dependencies = [- "futures-channel","futures-core",- "futures-io","futures-macro",- "futures-sink","futures-task",- "memchr","pin-project-lite","pin-utils","slab",@@ -805,12 +750,6 @@ version = "0.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"-[[package]]-name = "hermit-abi"-version = "0.5.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"-[[package]]name = "ident_case"version = "1.0.1"@@ -853,28 +792,17 @@ dependencies = ["serde_json",]-[[package]]-name = "is-terminal"-version = "0.4.16"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9"-dependencies = [- "hermit-abi",- "libc",- "windows-sys 0.59.0",-]-[[package]]name = "is_terminal_polyfill"-version = "1.70.1"+version = "1.70.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"+checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"[[package]]name = "itertools"-version = "0.10.5"+version = "0.13.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"+checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"dependencies = ["either",]@@ -1132,7 +1060,7 @@ version = "3.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983"dependencies = [- "toml_edit 0.23.7",+ "toml_edit",][[package]]@@ -1239,21 +1167,20 @@ dependencies = [[[package]]name = "rstest"-version = "0.23.0"+version = "0.26.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0a2c585be59b6b5dd66a9d2084aa1d8bd52fbdb806eafdeffb52791147862035"+checksum = "f5a3193c063baaa2a95a33f03035c8a72b83d97a54916055ba22d35ed3839d49"dependencies = [- "futures","futures-timer",+ "futures-util","rstest_macros",- "rustc_version",][[package]]name = "rstest_macros"-version = "0.23.0"+version = "0.26.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "825ea780781b15345a146be27eaefb05085e337e869bff01b4306a4fd4a9ad5a"+checksum = "9c845311f0ff7951c5506121a9ad75aec44d083c31583b2ea5a30bcb0b0abba0"dependencies = ["cfg-if","glob",@@ -1387,15 +1314,6 @@ dependencies = ["serde_core",]-[[package]]-name = "serde_spanned"-version = "0.6.9"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"-dependencies = [- "serde",-]-[[package]]name = "serde_spanned"version = "1.0.3"@@ -1546,40 +1464,21 @@ dependencies = ["serde_json",]-[[package]]-name = "toml"-version = "0.8.23"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"-dependencies = [- "serde",- "serde_spanned 0.6.9",- "toml_datetime 0.6.11",- "toml_edit 0.22.27",-]-[[package]]name = "toml"version = "0.9.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8"dependencies = [+ "indexmap","serde_core",- "serde_spanned 1.0.3",- "toml_datetime 0.7.3",+ "serde_spanned",+ "toml_datetime","toml_parser",+ "toml_writer","winnow",]-[[package]]-name = "toml_datetime"-version = "0.6.11"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"-dependencies = [- "serde",-]-[[package]]name = "toml_datetime"version = "0.7.3"@@ -1589,20 +1488,6 @@ dependencies = ["serde_core",]-[[package]]-name = "toml_edit"-version = "0.22.27"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"-dependencies = [- "indexmap",- "serde",- "serde_spanned 0.6.9",- "toml_datetime 0.6.11",- "toml_write",- "winnow",-]-[[package]]name = "toml_edit"version = "0.23.7"@@ -1610,7 +1495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6485ef6d0d9b5d0ec17244ff7eb05310113c3f316f2d14200d4de56b3cb98f8d"dependencies = ["indexmap",- "toml_datetime 0.7.3",+ "toml_datetime","toml_parser","winnow",]@@ -1625,10 +1510,10 @@ dependencies = [][[package]]-name = "toml_write"-version = "0.1.2"+name = "toml_writer"+version = "1.0.4"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"+checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"[[package]]name = "typeid"@@ -1650,9 +1535,9 @@ checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"[[package]]name = "unicode-ident"-version = "1.0.19"+version = "1.0.20"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d"+checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06"[[package]]name = "unicode-segmentation"@@ -2027,7 +1912,7 @@ dependencies = ["serde_json","tempfile","terminal_size",- "toml 0.8.23",+ "toml","unicode-width","vergen-gitcl",]diff --git a/Cargo.toml b/Cargo.tomlindex 1e1f4bce8..01339369e 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -24,25 +24,25 @@ clap = { version = "4.5", features = ["derive"] }clap_complete = "4.5"config = "0.15"directories = "6.0"-rayon = "1.10"+rayon = "1.11"serde = { version = "1.0", features = ["derive"] }serde_json = "1.0"terminal_size = "0.4"-toml = "0.8"+toml = "0.9"unicode-width = "0.2"[build-dependencies]-vergen-gitcl = { version = "1.0.0", features = ["build"] }+vergen-gitcl = { version = "1.0.8", features = ["build"] }[dev-dependencies]-insta = { version = "1.40", features = ["yaml", "redactions", "filters"] }+insta = { version = "1.43", features = ["yaml", "redactions", "filters"] }insta-cmd = "0.6"assert_cmd = "2.0"-tempfile = "3.14"-toml = "0.8"-rstest = "0.23"-criterion = "0.5"-regex = "1.10"+tempfile = "3.23"+toml = "0.9"+rstest = "0.26"+criterion = "0.7"+regex = "1.12"[[bench]]name = "completion"diff --git a/tests/snapshots/integration__integration_tests__init__init_elvish.snap b/tests/snapshots/integration__integration_tests__init__init_elvish.snapnew file mode 100644index 000000000..d94ce3bd1--- /dev/null+++ b/tests/snapshots/integration__integration_tests__init__init_elvish.snap@@ -0,0 +1,81 @@+---+source: tests/integration_tests/init.rs+info:+ program: wt+ args:+ - init+ - elvish+ env:+ CLICOLOR_FORCE: "1"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ LANG: C+ LC_ALL: C+ SOURCE_DATE_EPOCH: "1704067200"+---+success: false+exit_code: 1+----- stdout -----+# worktrunk shell integration for elvish++# Only initialize if wt is available+if (has-external wt) {+ # Helper function to parse wt output and handle directives+ fn _wt_exec {|@args|+ var exit-code = 0+ var output = ""++ # Capture output and handle potential non-zero exit+ try {+ set output = (e:wt $@args 2>&1 | slurp)+ } catch e {+ set exit-code = 1+ set output = $e[reason][content]+ }++ # Parse output line by line+ var lines = [(str:split "\n" $output)]+ for line $lines {+ if (str:has-prefix $line "__WORKTRUNK_CD__") {+ # Extract path and change directory+ var path = (str:trim-prefix $line "__WORKTRUNK_CD__")+ cd $path+ } else {+ # Regular output - print it+ echo $line+ }+ }++ # Return exit code (will throw exception if non-zero)+ if (!=s $exit-code 0) {+ fail "command failed with exit code "$exit-code+ }+ }++ # Override wt command to add --internal flag for switch, remove, and merge+ fn wt {|@args|+ if (== (count $args) 0) {+ e:wt+ return+ }++ var subcommand = $args[0]++ if (or (eq $subcommand "switch") (eq $subcommand "remove") (eq $subcommand "merge")) {+ # Commands that need --internal for directory change support+ var rest-args = $args[1..]+ _wt_exec $subcommand --internal $@rest-args+ } else {+ # All other commands pass through directly+ e:wt $@args+ }+ }+}++# Static completions (commands and flags)++----- stderr -----+β [31mCompletion not yet supported for elvish[0mdiff --git a/tests/snapshots/integration__integration_tests__init__init_nushell.snap b/tests/snapshots/integration__integration_tests__init__init_nushell.snapnew file mode 100644index 000000000..53579ed42--- /dev/null+++ b/tests/snapshots/integration__integration_tests__init__init_nushell.snap@@ -0,0 +1,71 @@+---+source: tests/integration_tests/init.rs+info:+ program: wt+ args:+ - init+ - nushell+ env:+ CLICOLOR_FORCE: "1"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ LANG: C+ LC_ALL: C+ SOURCE_DATE_EPOCH: "1704067200"+---+success: false+exit_code: 1+----- stdout -----+# worktrunk shell integration for nushell++# Only initialize if wt is available+if (which wt | is-not-empty) {+ # Helper function to parse wt output and handle directives+ export def --env _wt_exec [...args] {+ let result = (do { ^wt ...$args } | complete)++ # Parse output line by line+ let lines = ($result.stdout | lines)+ for line in $lines {+ if ($line | str starts-with "__WORKTRUNK_CD__") {+ # Extract path and change directory+ let path = ($line | str substring 16..)+ cd $path+ } else {+ # Regular output - print it+ print $line+ }+ }++ # Return the exit code+ return $result.exit_code+ }++ # Override wt command to add --internal flag for switch, remove, and merge+ # Use --wrapped to pass through all flags without parsing them+ export def --env --wrapped wt [...rest] {+ let subcommand = ($rest | get 0? | default "")++ match $subcommand {+ "switch" | "remove" | "merge" => {+ # Commands that need --internal for directory change support+ let rest_args = ($rest | skip 1)+ let internal_args = ([$subcommand, "--internal"] | append $rest_args)+ let exit_code = (_wt_exec ...$internal_args)+ return $exit_code+ }+ _ => {+ # All other commands pass through directly+ ^wt ...$rest+ }+ }+ }+}++# Static completions (commands and flags)++----- stderr -----+β [31mCompletion not yet supported for nushell[0mdiff --git a/tests/snapshots/integration__integration_tests__init__init_oil.snap b/tests/snapshots/integration__integration_tests__init__init_oil.snapnew file mode 100644index 000000000..a1ed52fc7--- /dev/null+++ b/tests/snapshots/integration__integration_tests__init__init_oil.snap@@ -0,0 +1,309 @@+---+source: tests/integration_tests/init.rs+info:+ program: wt+ args:+ - init+ - oil+ env:+ CLICOLOR_FORCE: "1"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ LANG: C+ LC_ALL: C+ SOURCE_DATE_EPOCH: "1704067200"+---+success: true+exit_code: 0+----- stdout -----+# worktrunk shell integration for oil++# Only initialize if wt is available+if command -v wt >/dev/null 2>&1; then+ # Helper function to parse wt output and handle directives+ _wt_exec() {+ local output line exit_code+ output="$(command wt "$@" 2>&1)"+ exit_code=$?++ # Parse output line by line+ while IFS= read -r line; do+ if [[ "$line" == __WORKTRUNK_CD__* ]]; then+ # Extract path and change directory+ \cd "${line#__WORKTRUNK_CD__}"+ else+ # Regular output - print it+ echo "$line"+ fi+ done <<< "$output"++ return $exit_code+ }++ # Override wt command to add --internal flag for switch, remove, and merge+ wt() {+ local subcommand="$1"++ case "$subcommand" in+ switch|remove|merge)+ # Commands that need --internal for directory change support+ shift+ _wt_exec "$subcommand" --internal "$@"+ ;;+ *)+ # All other commands pass through directly+ command wt "$@"+ ;;+ esac+ }++ # Dynamic completion function+ _wt_complete() {+ local cur="${COMP_WORDS[COMP_CWORD]}"++ # Call wt complete with current command line+ local completions=$(command wt complete "${COMP_WORDS[@]}" 2>/dev/null)+ COMPREPLY=($(compgen -W "$completions" -- "$cur"))+ }++ # Register dynamic completion+ complete -F _wt_complete wt+fi++# Static completions (commands and flags)+_wt() {+ local i cur prev opts cmd+ COMPREPLY=()+ if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then+ cur="$2"+ else+ cur="${COMP_WORDS[COMP_CWORD]}"+ fi+ prev="$3"+ cmd=""+ opts=""++ for i in "${COMP_WORDS[@]:0:COMP_CWORD}"+ do+ case "${cmd},${i}" in+ ",$1")+ cmd="wt"+ ;;+ wt,complete)+ cmd="wt__complete"+ ;;+ wt,completion)+ cmd="wt__completion"+ ;;+ wt,configure-shell)+ cmd="wt__configure__shell"+ ;;+ wt,init)+ cmd="wt__init"+ ;;+ wt,list)+ cmd="wt__list"+ ;;+ wt,merge)+ cmd="wt__merge"+ ;;+ wt,push)+ cmd="wt__push"+ ;;+ wt,remove)+ cmd="wt__remove"+ ;;+ wt,switch)+ cmd="wt__switch"+ ;;+ *)+ ;;+ esac+ done++ case "${cmd}" in+ wt)+ opts="-h -V --help --version init configure-shell list switch remove push merge completion complete"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;+ wt__complete)+ opts="-h --help [ARGS]..."+ 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__completion)+ opts="-h --help bash elvish fish nushell oil powershell xonsh zsh"+ 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__configure__shell)+ opts="-y -h --shell --cmd --yes --help"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ --shell)+ COMPREPLY=($(compgen -W "bash elvish fish nushell oil powershell xonsh zsh" -- "${cur}"))+ return 0+ ;;+ --cmd)+ COMPREPLY=($(compgen -f "${cur}"))+ return 0+ ;;+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;+ wt__init)+ opts="-h --cmd --help <SHELL>"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ --cmd)+ COMPREPLY=($(compgen -f "${cur}"))+ return 0+ ;;+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;+ wt__list)+ opts="-h --format --branches --help"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ --format)+ COMPREPLY=($(compgen -W "table json" -- "${cur}"))+ return 0+ ;;+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;+ wt__merge)+ opts="-s -k -h --squash --keep --help [TARGET]"+ 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__push)+ opts="-h --allow-merge-commits --help [TARGET]"+ 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__remove)+ opts="-h --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 -x -h --create --base --execute --help <BRANCH>"+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ fi+ case "${prev}" in+ --base)+ COMPREPLY=($(compgen -f "${cur}"))+ return 0+ ;;+ -b)+ COMPREPLY=($(compgen -f "${cur}"))+ return 0+ ;;+ --execute)+ COMPREPLY=($(compgen -f "${cur}"))+ return 0+ ;;+ -x)+ COMPREPLY=($(compgen -f "${cur}"))+ return 0+ ;;+ *)+ COMPREPLY=()+ ;;+ esac+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )+ return 0+ ;;+ esac+}++if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then+ complete -F _wt -o nosort -o bashdefault -o default wt+else+ complete -F _wt -o bashdefault -o default wt+fi++----- stderr -----diff --git a/tests/snapshots/integration__integration_tests__init__init_powershell.snap b/tests/snapshots/integration__integration_tests__init__init_powershell.snapnew file mode 100644index 000000000..4758590f7--- /dev/null+++ b/tests/snapshots/integration__integration_tests__init__init_powershell.snap@@ -0,0 +1,85 @@+---+source: tests/integration_tests/init.rs+info:+ program: wt+ args:+ - init+ - powershell+ env:+ CLICOLOR_FORCE: "1"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ LANG: C+ LC_ALL: C+ SOURCE_DATE_EPOCH: "1704067200"+---+success: false+exit_code: 1+----- stdout -----+# worktrunk shell integration for PowerShell++# Only initialize if wt is available+if (Get-Command wt -ErrorAction SilentlyContinue) {+ # Helper function to parse wt output and handle directives+ function _wt_exec {+ param(+ [Parameter(ValueFromRemainingArguments=$true)]+ [string[]]$Arguments+ )++ # Capture output and exit code+ $output = & wt @Arguments 2>&1+ $exitCode = $LASTEXITCODE++ # Parse output line by line+ foreach ($line in $output) {+ if ($line -match '^__WORKTRUNK_CD__(.+)$') {+ # Extract path and change directory+ Set-Location $matches[1]+ } else {+ # Regular output - write it+ Write-Output $line+ }+ }++ # Return the exit code+ return $exitCode+ }++ # Override wt command to add --internal flag for switch, remove, and merge+ function wt {+ param(+ [Parameter(ValueFromRemainingArguments=$true)]+ [string[]]$Arguments+ )++ if ($Arguments.Count -eq 0) {+ & wt+ return $LASTEXITCODE+ }++ $subcommand = $Arguments[0]++ switch ($subcommand) {+ { $_ -in @("switch", "remove", "merge") } {+ # Commands that need --internal for directory change support+ $restArgs = $Arguments[1..($Arguments.Count-1)]+ $exitCode = _wt_exec $subcommand --internal @restArgs+ return $exitCode+ }+ default {+ # All other commands pass through directly+ & wt @Arguments+ return $LASTEXITCODE+ }+ }+ }+}++# Static completions (commands and flags)++----- stderr -----+β [31mCompletion not yet supported for powershell[0mdiff --git a/tests/snapshots/integration__integration_tests__init__init_xonsh.snap b/tests/snapshots/integration__integration_tests__init__init_xonsh.snapnew file mode 100644index 000000000..c0a7070b1--- /dev/null+++ b/tests/snapshots/integration__integration_tests__init__init_xonsh.snap@@ -0,0 +1,70 @@+---+source: tests/integration_tests/init.rs+info:+ program: wt+ args:+ - init+ - xonsh+ env:+ CLICOLOR_FORCE: "1"+ GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"+ GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"+ GIT_CONFIG_GLOBAL: /dev/null+ GIT_CONFIG_SYSTEM: /dev/null+ GIT_EDITOR: ""+ LANG: C+ LC_ALL: C+ SOURCE_DATE_EPOCH: "1704067200"+---+success: false+exit_code: 1+----- stdout -----+# worktrunk shell integration for xonsh++# Only initialize if wt is available+import shutil+if shutil.which("wt") is not None:+ def _wt_exec(args):+ """Helper function to parse wt output and handle directives"""+ # Capture full output including return code+ result = !(wt @(args))++ # Parse output line by line+ if result.out:+ for line in result.out.splitlines():+ if line.startswith("__WORKTRUNK_CD__"):+ # Extract path and change directory+ path = line[17:] # Remove prefix+ cd @(path)+ else:+ # Regular output - print it+ print(line)++ # Return the exit code+ return result.returncode++ def _wt_wrapper(args):+ """Override wt command to add --internal flag for switch, remove, and merge"""+ if not args:+ # No arguments, just run wt+ wt+ return++ subcommand = args[0]++ if subcommand in ["switch", "remove", "merge"]:+ # Commands that need --internal for directory change support+ rest_args = args[1:]+ return _wt_exec([subcommand, "--internal"] + rest_args)+ else:+ # All other commands pass through directly+ result = !(wt @(args))+ return result.returncode++ # Register the alias+ aliases['wt'] = _wt_wrapper++# Static completions (commands and flags)++----- stderr -----+β [31mCompletion not yet supported for xonsh[0m