fix(cli): treat leading non-flag argument as target account for precise error feedback

This commit is contained in:
operator
2026-10-05 16:05:50 +00:00
parent 983b5c668c
commit 063ed2b47b
+4 -9
View File
@@ -39,15 +39,10 @@ show_usage() {
ACCOUNT=""
POSITIONAL=()
# Pre-check if first argument is a valid account name (e.g. 'muse 646 ...')
if [[ $# -gt 0 ]]; then
for acct in "${VALID_ACCOUNTS[@]}"; do
if [[ "$1" == "$acct" ]]; then
ACCOUNT="$1"
shift
break
fi
done
# If first argument does not start with '-', treat it as the account candidate
if [[ $# -gt 0 && "$1" != -* ]]; then
ACCOUNT="$1"
shift
fi
while [[ $# -gt 0 ]]; do