Add logic for option parsing

It's not parsing LONG options though.  Have to look into this.