From: Vladimir Prus (ghost_at_[hidden])
Date: 2001-11-16 08:19:31
> Just a couple of classes I wrote that I wondered if anyone thought
> any place in boost:
> arguments : simple command-line arguments and options parser:
> class arguments
> arguments(int argc, char* argv);
> bool has_option(const char* name) const;
> bool get_option(const char* name, bool& value) const;
> Any interest? Already proposed? Wasting my time?
Actually, I'm already working on library with the same goals but more
elaborated. Moreover, it's almost finished. I planned to announce it later,
but have to do it now. My design goals were:
- It should be resonable to use the library to parse as little as 2 command
- It must be extandable to privide any resonable handling
- since command line is just a way to affect the program behaviour, other
ways to accomplish that must be provided, most notable is configuration file
- library should provide a way to store information from command line and
config file in a way allowing easy retrieval and using to change configurable
parameters of the program.
The docs are available at:
Let me know what you think.
Concerning your proposal, I can mark two points, apart from it's been a
subset of mine:
1. It uses get_options(const char* name, type& value) methods, which are not
extendable (and the similar thing is used in KConfig class in KDE....) What I
variables_map vm .....
int i = vm["magic"].as<int>()
FontName fn = vm["font"].as<FontName>()
2. You propose wildcard expansions. This is good. But it is easy to add it to
any existing command line parsing library.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk