fix(install): honor comma-separated --tool list (as the help documents) (#678)

The help text advertised `--tool <a,b>` (a comma list), but --tool took a
single value and validated it whole, so `--tool claude-code,cursor` failed
with "Unknown tool 'claude-code,cursor'". --division and --agent already
split on commas; --tool didn't (#671).

Split --tool on commas, trim each entry, and validate each against
ALL_TOOLS (mirrors --division), so a bad entry still errors clearly by
name. Single-tool use is unchanged.

Verified: --tool claude-code,cursor installs both; "claude-code, cursor"
(with spaces) works; --tool claude-code,nope errors on 'nope'; --tool
cursor still works.

Fixes #671


Claude-Session: https://claude.ai/code/session_01WKnDRWM4izsB8WAXKszhsq

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Michael Sitarzewski
2026-07-06 14:43:03 -05:00
committed by GitHub
parent 1b31b7a670
commit 3293712e41
+15 -8
View File
@@ -1183,14 +1183,21 @@ main() {
check_integrations
# Validate explicit tool
# Validate explicit tool(s). --tool accepts a comma-separated list (like
# --division / --agent), e.g. --tool claude-code,cursor.
local _tool_list=()
if [[ "$tool" != "all" ]]; then
local valid=false t
for t in "${ALL_TOOLS[@]}"; do [[ "$t" == "$tool" ]] && valid=true && break; done
if ! $valid; then
err "Unknown tool '$tool'. Valid: ${ALL_TOOLS[*]}"
exit 1
fi
local _t
IFS=',' read -ra _tool_list <<< "$tool"
local _cleaned=()
for _t in "${_tool_list[@]}"; do
_t="$(printf '%s' "$_t" | xargs)"; [[ -z "$_t" ]] && continue
local valid=false _vt
for _vt in "${ALL_TOOLS[@]}"; do [[ "$_vt" == "$_t" ]] && valid=true && break; done
$valid || { err "Unknown tool '$_t'. Valid: ${ALL_TOOLS[*]}"; exit 1; }
_cleaned+=("$_t")
done
_tool_list=("${_cleaned[@]}")
fi
# Decide whether to show interactive UI
@@ -1207,7 +1214,7 @@ main() {
: # wizard committed SELECTED_TOOLS + FILTER_DIVISIONS
elif [[ "$tool" != "all" ]]; then
SELECTED_TOOLS=("$tool")
SELECTED_TOOLS=("${_tool_list[@]}")
else
# Non-interactive (or no TTY): auto-detect