I am writing a command line tool in C++ that takes several arguments, some of them file names but also option parameters.
Is there a standard way to parse and implement these options? A simple way would be to clean the input and use a map to convert it to an integer and use a switch statement in the main.cpp. But that strikes me as leading to a bloated main.cpp. How do other command line tools, like vim, sed etc. deal with interpreting options?
I would be much grateful if you could point me to some examples or documentation.