Standard command line argument parser.

3

31337one

Hello all,

I was wondering if there is a C/C++ command line parser that works for
linux AND windows. .

Anyways, the ideal parser im looking for should be able to support
multiple
arguments per option.

Example: $> myProg --option1 arg arg arg --option2 arg --option3 arg
arg arg.

I have looked at GetOpt_long with no success. I am using visual studio
2003 and Getopt is not included. I am also unable to locate a place to
download the source. I know they are already in Linux distributions but
I need them to try them in windows as well.

Any help would be greatly appreciated.

Thanks
 
M

mlimber

I was wondering if there is a C/C++ command line parser that works for
linux AND windows. .

Anyways, the ideal parser im looking for should be able to support
multiple
arguments per option.

Example: $> myProg --option1 arg arg arg --option2 arg --option3 arg
arg arg.

I have looked at GetOpt_long with no success. I am using visual studio
2003 and Getopt is not included. I am also unable to locate a place to
download the source. I know they are already in Linux distributions but
I need them to try them in windows as well.

Any help would be greatly appreciated.

Try:

http://boost.org/doc/html/program_options.html

or the links found here:

http://www.parashift.com/c++-faq-lite/class-libraries.html#faq-37.9

Cheers! --M
 
T

Tom Plunket

31337one said:
That does not appear to support multiple arguments per option. I have
already looked into it.

For a "elite one", it seems a strange question to ask.

Especially considering I recently implemented a typesafe command-line
parser that automatically dumped the options into same-named global
variables with TDD in like 100 lines of code. It's not exactly rocket
science.

I can't share the code as it was written in the employ of a company.
 
3

31337one

Tom said:
For a "elite one", it seems a strange question to ask.

Especially considering I recently implemented a typesafe command-line
parser that automatically dumped the options into same-named global
variables with TDD in like 100 lines of code. It's not exactly rocket
science.

I can't share the code as it was written in the employ of a company.


I have written a command line parser for my project as well. Other
engineers that I am working with want to a use some standard command
line parser. They suggest getopt but its not even in Visual Studio.
They point me to a windows port of it, well it needs to be on both
windows andl linux. Well there isnt a STANDARD one for both linux and
windows that has the options I need.

If it was my choice, I'd use my parser, it works fine, it supports
multiple arguments per option and its already done and implemented.
Finding one to replace it is wasting more time than it is worth.

Yeah, it does feel dumb asking this question. I have scoured the
internet for something small and compatible and had no luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top