Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion templates/bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ wt_exec() {
_clap_complete_wt
fi
}
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
fi
fi

----- stderr -----