This video goes through the process of making a command line argument flag parser, much better than getopt!
No download links available.