Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
refactor: Rename --dev flag to --source
Maximilian Roos543dbf00f8fe
diff --git a/templates/bash.sh b/templates/bash.shindex 0e7858ea9..0995c2001 100644--- a/templates/bash.sh+++ b/templates/bash.sh@@ -54,21 +54,21 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then# Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge{{ cmd_prefix }}() {- local use_dev=false+ local use_source=falselocal args=()local saved_cmd="$_WORKTRUNK_CMD"- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg in "$@"; do- if [[ "$arg" == "--dev" ]]; then- use_dev=true+ if [[ "$arg" == "--source" ]]; then+ use_source=trueelseargs+=("$arg")fidone- # If --dev was specified, build and use local debug binary- if [[ "$use_dev" == true ]]; then+ # If --source was specified, build and use local debug binary+ if [[ "$use_source" == true ]]; thenif ! cargo build --quiet >/dev/null 2>&1; thenecho "Error: cargo build failed" >&2_WORKTRUNK_CMD="$saved_cmd"diff --git a/templates/elvish.elv b/templates/elvish.elvindex 177124b36..23e11cd86 100644--- a/templates/elvish.elv+++ b/templates/elvish.elv@@ -55,21 +55,21 @@ if (or (has-external wt) (has-env WORKTRUNK_BIN)) {# Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and mergefn {{ cmd_prefix }} {|@args|- var use-dev = $false+ var use-source = $falsevar filtered-args = []var saved-cmd = $_WORKTRUNK_CMD- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg $args {- if (eq $arg "--dev") {- set use-dev = $true+ if (eq $arg "--source") {+ set use-source = $true} else {set filtered-args = [$@filtered-args $arg]}}- # If --dev was specified, build and use local debug binary- if $use-dev {+ # If --source was specified, build and use local debug binary+ if $use-source {try {e:cargo build --quiet 2>&1 | slurp} catch e {diff --git a/templates/fish.fish b/templates/fish.fishindex c1001e86d..de1d5f1f1 100644--- a/templates/fish.fish+++ b/templates/fish.fish@@ -90,21 +90,21 @@ if type -q {{ cmd_prefix }}; or set -q WORKTRUNK_BIN# Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and mergefunction {{ cmd_prefix }}- set -l use_dev false+ set -l use_source falseset -l argsset -l saved_cmd $_WORKTRUNK_CMD- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg in $argv- if test "$arg" = "--dev"- set use_dev true+ if test "$arg" = "--source"+ set use_source trueelseset -a args $argendend- # If --dev was specified, build and use local debug binary- if test $use_dev = true+ # If --source was specified, build and use local debug binary+ if test $use_source = trueif not cargo build --quiet >/dev/null 2>&1echo "Error: cargo build failed" >&2set _WORKTRUNK_CMD $saved_cmddiff --git a/templates/nushell.nu b/templates/nushell.nuindex 0a8f7a717..035e07d40 100644--- a/templates/nushell.nu+++ b/templates/nushell.nu@@ -42,20 +42,20 @@ if (which wt | is-not-empty) or ($env.WORKTRUNK_BIN? | is-not-empty) {# Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge# Use --wrapped to pass through all flags without parsing themexport def --env --wrapped {{ cmd_prefix }} [...rest] {- mut use_dev = false+ mut use_source = falsemut filtered_args = []- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg in $rest {- if $arg == "--dev" {- $use_dev = true+ if $arg == "--source" {+ $use_source = true} else {$filtered_args = ($filtered_args | append $arg)}}# Determine which command to use- let cmd = if $use_dev {+ let cmd = if $use_source {let build_result = (do { cargo build --quiet } | complete)if $build_result.exit_code != 0 {print "Error: cargo build failed"diff --git a/templates/powershell.ps1 b/templates/powershell.ps1index efdd2d0e2..023bc101e 100644--- a/templates/powershell.ps1+++ b/templates/powershell.ps1@@ -56,20 +56,20 @@ if ((Get-Command wt -ErrorAction SilentlyContinue) -or $env:WORKTRUNK_BIN) {[string[]]$Arguments)- $useDev = $false+ $useSource = $false$filteredArgs = @()- # Check for --dev flag and strip it+ # Check for --source flag and strip itforeach ($arg in $Arguments) {- if ($arg -eq "--dev") {- $useDev = $true+ if ($arg -eq "--source") {+ $useSource = $true} else {$filteredArgs += $arg}}# Determine which command to use- if ($useDev) {+ if ($useSource) {# Build the projectcargo build --quiet 2>&1 | Out-Nullif ($LASTEXITCODE -ne 0) {diff --git a/templates/xonsh.xsh b/templates/xonsh.xshindex d46104e77..f3b605e53 100644--- a/templates/xonsh.xsh+++ b/templates/xonsh.xsh@@ -44,18 +44,18 @@ if shutil.which("wt") is not None or os.environ.get('WORKTRUNK_BIN'):def _{{ cmd_prefix }}_wrapper(args):"""Override {{ cmd_prefix }} command to add --internal flag for switch, remove, and merge"""- use_dev = False+ use_source = Falsefiltered_args = []- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg in args:- if arg == "--dev":- use_dev = True+ if arg == "--source":+ use_source = Trueelse:filtered_args.append(arg)# Determine which command to use- if use_dev:+ if use_source:# Build the projectbuild_result = !(cargo build --quiet)if build_result.returncode != 0:diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snapindex 99c6e1bff..1029bde00 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap@@ -16,7 +16,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpwN6n08/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAVt9Qw/test-config.toml---success: trueexit_code: 0@@ -77,21 +77,21 @@ if command -v wt >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]]; then# Override wt command to add --internal flag for switch, remove, and mergewt() {- local use_dev=false+ local use_source=falselocal args=()local saved_cmd="$_WORKTRUNK_CMD"- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg in "$@"; do- if [[ "$arg" == "--dev" ]]; then- use_dev=true+ if [[ "$arg" == "--source" ]]; then+ use_source=trueelseargs+=("$arg")fidone- # If --dev was specified, build and use local debug binary- if [[ "$use_dev" == true ]]; then+ # If --source was specified, build and use local debug binary+ if [[ "$use_source" == true ]]; thenif ! cargo build --quiet >/dev/null 2>&1; thenecho "Error: cargo build failed" >&2_WORKTRUNK_CMD="$saved_cmd"diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snapindex bfaefa54b..9d80f2c6e 100644--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap@@ -16,7 +16,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmplxtrjb/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpAEvMAL/test-config.toml---success: trueexit_code: 0@@ -113,21 +113,21 @@ if type -q wt; or set -q WORKTRUNK_BIN# Override wt command to add --internal flag for switch, remove, and mergefunction wt- set -l use_dev false+ set -l use_source falseset -l argsset -l saved_cmd $_WORKTRUNK_CMD- # Check for --dev flag and strip it+ # Check for --source flag and strip itfor arg in $argv- if test "$arg" = "--dev"- set use_dev true+ if test "$arg" = "--source"+ set use_source trueelseset -a args $argendend- # If --dev was specified, build and use local debug binary- if test $use_dev = true+ # If --source was specified, build and use local debug binary+ if test $use_source = trueif not cargo build --quiet >/dev/null 2>&1echo "Error: cargo build failed" >&2set _WORKTRUNK_CMD $saved_cmd