mirror of
https://github.com/msitarzewski/agency-agents/
synced 2026-06-09 10:13:17 +00:00
refactor(install): replace usage() magic line numbers with sentinels (#506)
Thanks @ShaoJiaZhen! 🙏
This commit is contained in:
+8
-1
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# --- USAGE-START --- (sentinel for usage(); do not remove)
|
||||
# install.sh -- Install The Agency agents into your local agentic tool(s).
|
||||
#
|
||||
# Reads converted files from integrations/ and copies them to the appropriate
|
||||
@@ -31,6 +32,7 @@
|
||||
# --jobs N Max parallel jobs when using --parallel (default: nproc or 4)
|
||||
# --help Show this help
|
||||
#
|
||||
# --- USAGE-END --- (sentinel for usage(); do not remove)
|
||||
# Platform support:
|
||||
# Linux, macOS (requires bash 3.2+), Windows Git Bash / WSL
|
||||
|
||||
@@ -114,7 +116,12 @@ AGENT_DIRS=(
|
||||
# Usage
|
||||
# ---------------------------------------------------------------------------
|
||||
usage() {
|
||||
sed -n '3,32p' "$0" | sed 's/^# \{0,1\}//'
|
||||
# Extract everything between the USAGE-START / USAGE-END sentinels
|
||||
# (excluding the sentinel lines themselves) and strip the leading "# ".
|
||||
# Using sentinels instead of hard-coded line numbers means adding lines
|
||||
# to the header comment block won't silently break --help output.
|
||||
sed -n '/^# --- USAGE-START ---/,/^# --- USAGE-END ---/p' "$0" \
|
||||
| sed -e '1d;$d' -e 's/^# \{0,1\}//'
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user