Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -135,6 +135,16 @@ list_agents_raw() {
|
||||
done
|
||||
}
|
||||
|
||||
# ── Naming convention ─────────────────────────────────────────────────────
|
||||
# Normalizes an agent ID to an env-var suffix.
|
||||
# Convention: uppercase, hyphens → underscores. No stripping of suffixes.
|
||||
# "assistant-bot" → "ASSISTANT_BOT"
|
||||
# "asistente-2" → "ASISTENTE_2"
|
||||
# "devops-bot" → "DEVOPS_BOT"
|
||||
normalize_id() {
|
||||
echo "$1" | tr '[:lower:]-' '[:upper:]_'
|
||||
}
|
||||
|
||||
# ── Usage helper ──────────────────────────────────────────────────────────
|
||||
need_arg() {
|
||||
[[ -n "${1:-}" ]] || { echo "Usage: $0 <agent-id>"; exit 1; }
|
||||
|
||||
Reference in New Issue
Block a user