Use the flag package to handle command line options.
avoid using global variables.
Merge pull request #3 from pooya/master

Cleanup command line options