I am looking for a very simple explanation/tutorial on what flags are. I understand that flags work indicate a command what to do. For example:
rm -Rf test <
The easiest thing is to write your main() like so:
main()
int main(int argc, char* argv[]) { ...
Then inside that main you decide what happens to the command line arguments or "flags". You find them in argv and their number is argc.