That wouldn't work in the general case. Those patterns would also match long options. If I add a case pattern `--all)`, and I call the script with `--all`, it's also going to match
-*a*|--arg)
You could fix that with:
-a*|-[!-]*a*|--arg)
> It doesn't support args of the form -avalue but those a pretty uncommon anyway.
You could
-a*|-[!-]*a*|--arg)
if [[ "$1" != --arg ]]; then
value="${1#*a}"
fi
if [[ ! "$value" ]]; then
value="$2"
shift
fi
;;&
Putting the option stuck together to its value has the advantage of working nicely with brace expansion. For example, you can call `strace -p{1111,2222,3333}` to trace those 3 pids and avoid having to type `-p` 3 times.