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=""
|
ACCOUNT=""
|
||||||
POSITIONAL=()
|
POSITIONAL=()
|
||||||
|
|
||||||
# Pre-check if first argument is a valid account name (e.g. 'muse 646 ...')
|
# If first argument does not start with '-', treat it as the account candidate
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 && "$1" != -* ]]; then
|
||||||
for acct in "${VALID_ACCOUNTS[@]}"; do
|
ACCOUNT="$1"
|
||||||
if [[ "$1" == "$acct" ]]; then
|
shift
|
||||||
ACCOUNT="$1"
|
|
||||||
shift
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
|
|||||||
Reference in New Issue
Block a user