Fix last short option in concatenated form does not consume next argument

If -1 does not consume argument and -2 does, in the old implementation,
command line "-12 foo" does not parse because -2 is assumed to take
empty string as an argument and foo is unrecognized argument.
With this change, -2 correctly takes foo as an argument.
Use charAt instead of substring when extracting 1 character