I am trying to use getopt_long for my code. The optional_argument and required_argument options are working as desired but the no_Argument option is not working properly. This is how I am coding it.
struct option long_option[] =
{
{"auto",required_argument,0,'a'},
{"help",no_argument,0,'h'},
{"list",no_argument,0,'l'},
{0,0,0,0}
};
Now if I compile and try:
./a.out --help
--> shows all the help contents
./a.out --help 1234
--> still shows all the help contents. It should prompt an error that argument not required??