I am using function getopt_long
to get command line options.
I want to ignore error when a invalid option is given.
Currently it printing error to stderr like:
invalid option -- 's'
There's variable opterr
in unistd.h
which will avoid printing the the error to stderr
if you set it to 0.
Just set it to 0:
#include <unistd.h>
opterr = 0;