Skip to content

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.sh
index 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=false
local args=()
local saved_cmd="$_WORKTRUNK_CMD"
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for arg in "$@"; do
- if [[ "$arg" == "--dev" ]]; then
- use_dev=true
+ if [[ "$arg" == "--source" ]]; then
+ use_source=true
else
args+=("$arg")
fi
done
- # 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 ]]; then
if ! cargo build --quiet >/dev/null 2>&1; then
echo "Error: cargo build failed" >&2
_WORKTRUNK_CMD="$saved_cmd"
diff --git a/templates/elvish.elv b/templates/elvish.elv
index 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 merge
fn {{ cmd_prefix }} {|@args|
- var use-dev = $false
+ var use-source = $false
var filtered-args = []
var saved-cmd = $_WORKTRUNK_CMD
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for 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.fish
index 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 merge
function {{ cmd_prefix }}
- set -l use_dev false
+ set -l use_source false
set -l args
set -l saved_cmd $_WORKTRUNK_CMD
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for arg in $argv
- if test "$arg" = "--dev"
- set use_dev true
+ if test "$arg" = "--source"
+ set use_source true
else
set -a args $arg
end
end
- # 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 = true
if not cargo build --quiet >/dev/null 2>&1
echo "Error: cargo build failed" >&2
set _WORKTRUNK_CMD $saved_cmd
diff --git a/templates/nushell.nu b/templates/nushell.nu
index 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 them
export def --env --wrapped {{ cmd_prefix }} [...rest] {
- mut use_dev = false
+ mut use_source = false
mut filtered_args = []
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for 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.ps1
index 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 it
foreach ($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 project
cargo build --quiet 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
diff --git a/templates/xonsh.xsh b/templates/xonsh.xsh
index 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 = False
filtered_args = []
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for arg in args:
- if arg == "--dev":
- use_dev = True
+ if arg == "--source":
+ use_source = True
else:
filtered_args.append(arg)
# Determine which command to use
- if use_dev:
+ if use_source:
# Build the project
build_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.snap
index 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: C
LC_ALL: C
SOURCE_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: true
exit_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 merge
wt() {
- local use_dev=false
+ local use_source=false
local args=()
local saved_cmd="$_WORKTRUNK_CMD"
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for arg in "$@"; do
- if [[ "$arg" == "--dev" ]]; then
- use_dev=true
+ if [[ "$arg" == "--source" ]]; then
+ use_source=true
else
args+=("$arg")
fi
done
- # 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 ]]; then
if ! cargo build --quiet >/dev/null 2>&1; then
echo "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.snap
index 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: C
LC_ALL: C
SOURCE_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: true
exit_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 merge
function wt
- set -l use_dev false
+ set -l use_source false
set -l args
set -l saved_cmd $_WORKTRUNK_CMD
- # Check for --dev flag and strip it
+ # Check for --source flag and strip it
for arg in $argv
- if test "$arg" = "--dev"
- set use_dev true
+ if test "$arg" = "--source"
+ set use_source true
else
set -a args $arg
end
end
- # 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 = true
if not cargo build --quiet >/dev/null 2>&1
echo "Error: cargo build failed" >&2
set _WORKTRUNK_CMD $saved_cmd