Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Scanning for Options in C

Name: Anonymous 2010-10-29 4:12

Hi guys. I was wondering what the most common way to check for options, declared with '-' at the command line, is in C. For example: prog -a filename would run the program prog with the -a option. I assume it involves scanning with getopt. Thanks.

Name: Anonymous 2010-10-29 4:36

>>1
You assume correctly. Now, what was the point of your thread again?

Name: Anonymous 2010-10-29 4:45

I wrote my own piece of code that has more sane structure for describing options, supports --long-args and can generate usage message automatically.

Name: Anonymous 2010-10-29 4:58

>>4
So you wrote another getopt clone that does the same thing as every other getopt clone in history?

Name: Anonymous 2010-10-29 5:09

>>6
His version has support for ``--long-args''.

Name: Anonymous 2010-10-29 5:44

>>6
-1 for quoting your own post.

Name: Anonymous 2010-10-29 6:09

>>5
No, it also supports --long-args and prints usage message, and usage for options is in the same struct as options themselves, and it also does pretty text-wrapping while printing usage.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List