getopt

getopt() is a POSIX C function used to parse command-line options of the Unix/POSIX style on C. It is a part of the POSIX specification, and is universal to Unix-like systems. It is also the name of a Unix program for parsing command line arguments in shell scripts.