fix(cli): treat leading non-flag argument as target account for precise error feedback
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user