- It means `-thing` != `-t -h -i -n -g`, so the latter has to be that long;
- You also can't have `readable-long-things-as-an-option`;
- You can't (or not without crazy logic and a confusing UX) have variables passed with no space, like `-ffoobar`
This behaviour is defined in POSIX, btw:
>If the SYNOPSIS of a standard utility shows an option with a mandatory option-argument (as with [-c option_argument] in the example), a conforming application shall use separate arguments for that option and its option-argument. However, a conforming implementation shall also permit applications to specify the option and option-argument in the same argument string without intervening <blank> characters.
I suppose I don't mind that syntax anymore now. Thanks for changing my mind :)
This is trivially achievable with getopts(1):
while getopts u: Option
do
case "$Option"
in
u)
User="$OPTARG"
;;
esac
done
The colon tells getopts(1) that the -u option expects an argument. This behavior is also mandated by the POSIX specification.