moved option parsing into its own function
Merge pull request #2 from fowlmouth/patch99

moved option parsing into its own function