Function to parse command line options
Added code to main function