Hi,
Does anyone have an example or tutorial, on how to use getopt_long_only?
I've looked at the documentation, but it's not so clear to me. Googling only seems to return man page type stuff.
Thank you!
Hi,
Does anyone have an example or tutorial, on how to use getopt_long_only?
I've looked at the documentation, but it's not so clear to me. Googling only seems to return man page type stuff.
Thank you!
When all else fails, there's Wikipedia.
getopt - Wikipedia, the free encyclopedia
Thank you. Yes, I saw that, but it doesn't explain things like
what the heck are the 1,0,0 etc for? What do those mean?Code:static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 1, 0, 'c'}, {"file", 1, 0, 0}, {NULL, 0, NULL, 0} };
Last edited by dayalsoap; 09-22-2010 at 06:00 PM.
I still haven't been able to find a more thorough example or tutorial.
How about using google to find man? getopt_long(3): Parse options - Linux man page
Is it blatantly obvious and there's just something that I'm missing?
Yes. Look at the definition for struct option in that man page.Originally Posted by dayalsoap