I recently started using arguments in my main program (here written in C++
but could be any programming language)
#include <iostream>
int main(int argn, char* argv[]) {
// do stuff depending on argv[1], argv[2], etc.
}
For now I am using mostly random naming conventions like -t
for testing, -d
for debugging, -l
for printing logs e.g. There is no need for adding -
, it is just that most shell parameters are named that way. I also use --
for second parameters.
Is there any established naming conventions for main arguments ?
2
Gnu Standards and GNU long argument names
Microsoft’s suggestions
0