Replace --exec-arg with an ergonomic --exec that consumes the rest of the line as the click command. The caller's shell tokenizes the words into discrete arguments before the tool sees them, and the shell runs them as positional parameters (never a re-parsed string), so safety is identical to the argv form while the call sites read naturally: `--exec omarchy toggle something`. Crucially the tool never splits a string itself — a single quoted whole-command argument is rejected and points at the unquoted form, because whitespace- splitting a string hands argument boundaries to whoever controls its content (the injection we are avoiding). --exec must come last; migrate every caller.
12 lines
433 B
Bash
12 lines
433 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# Omarchy ships no default agent, so invite once rather than picking one. An
|
|
# agent already chosen means the invitation has nothing to offer.
|
|
if [[ -z $(omarchy-default-agent) ]] && omarchy-done ensure agent-setup-invitation; then
|
|
omarchy-notification-send -u critical -g "Set your default agent" \
|
|
"Let your favorite agent help with Omarchy." \
|
|
--exec omarchy menu summon setup.default.agent
|
|
fi
|