added the working logic for the getopt()
Parsing command line arguments using getopt()
corrected the bracket closing error
Code review changes - Simplified the required parameter logic