Added command-line parsing with simple error handling