There is a `CommandLineParser` class for arguments parsing. I'm not sure if it is documented but you can make this sample cleaner with it.