C-like getopt behavior.