copy from android, bionic's libc/unistd/getopt_long.c