With C/ C++, getopt_long()
can be used to parse command line arguments. Is it possible to tell the function that some of the options are mandatory? For example, how can I tell getopt_long
that the parsing should give error if startServer
is called without mentioning the port below?
./startServer -port 80
Note: I am not talking of option arguments as mandatory but rather the options themselves.