Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
fix: Make bash completion nosort option conditional for macOS (#37)
Maximilian Roos1407051e35d1
diff --git a/templates/bash.sh b/templates/bash.shindex cf65ab815..9fca97087 100644--- a/templates/bash.sh+++ b/templates/bash.sh@@ -73,5 +73,10 @@ if command -v {{ cmd_prefix }} >/dev/null 2>&1 || [[ -n "${WORKTRUNK_BIN:-}" ]];_clap_complete_{{ cmd_prefix }}fi}- complete -o nospace -o bashdefault -o nosort -F _wt_lazy_complete {{ cmd_prefix }}+ # nosort requires Bash 4.4+ (macOS ships with 3.2)+ if [[ ${BASH_VERSINFO[0]} -gt 4 || (${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -ge 4) ]]; then+ complete -o nospace -o bashdefault -o nosort -F _wt_lazy_complete {{ cmd_prefix }}+ else+ complete -o nospace -o bashdefault -F _wt_lazy_complete {{ cmd_prefix }}+ fifidiff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snapindex d2e6d8260..b97f94877 100644--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap@@ -185,7 +185,12 @@ wt_exec() {_clap_complete_wtfi}- complete -o nospace -o bashdefault -o nosort -F _wt_lazy_complete wt+ # nosort requires Bash 4.4+ (macOS ships with 3.2)+ if [[ ${BASH_VERSINFO[0]} -gt 4 || (${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -ge 4) ]]; then+ complete -o nospace -o bashdefault -o nosort -F _wt_lazy_complete wt+ else+ complete -o nospace -o bashdefault -F _wt_lazy_complete wt+ fifi----- stderr -----