1 This is the README for libgetopt++. Libgetopt++ is a C++ library for command
6 1) Minimal footprint in main.cc, and no header or source changes outside the
7 user of an option when the option is altered/a new option added.
8 2) Multiple option sets can co-exist safely. The default option set is a
9 singleton, but additional static sets can be created and used.
10 3) Easy to use. Adding a new option is simply a case of adding a static
11 variable (can be a class member for instance) for the option, in the scope
12 that the option needs to be visible - be that class scope or translation
14 4) There are (will be when feature complete) multiple concrete Option classes
15 provided (currently BoolOption is the only one implemented).
16 5) Extensible. Simply create a new subclass of Option to implement a new
17 Option type, and use it in your program.
19 Libgetopt++ is licenced under the GPL.
21 The primary mailing list for discussion of libgetopt++ is
22 cygwin-apps@cygwin.com (unless/until traffic on libgetopt++ becomes worthy
23 of a dedicated list). Use this list for all bug reports, development discussion
27 Currently there are no user distributions that I know of. Libgetopt++ source is
28 available via anonymous cvs from
29 :pserver:sources.redhat.com:/cvs/cygwin-apps/libgetopt++.
32 For libgetopt++ developers:
33 You need autoconf 2.52 or better, automake 1.5 or better, and a recent libtool.
34 Depending on your platform static and or shared libraries will be built by
35 default. You will also need a C++ compiler, a linker and other such usual tools.
37 Once you have the source, and the required tools, run ./bootstrap.sh in the
38 top of the source tree. This should succeed - if it doesn't check you have all
39 the tools available and working before seeking help from the mailing list.
41 After successfully running the bootstrap.sh script, you can follow the user
42 building instructions below. As a developer you will likely want to build in
43 a separate directory to the source code, and to add --enable-maintainer-mode
44 and --enable-dependency-tracking to the configure line.
46 For libgetopt++ users:
47 You only need a C++ compiler toolchain. The user distributions include a
48 pregenerated configure script.
51 1) unpack the source somewhere.
52 2) (optional) make a separate build directory - ie $(path to source)/build
53 3) cd to wherever you plan to build from - either a dedicated directory
54 or the top level source directory.
55 4) run $(path to source)/configure
58 Installing libgetopt++:
59 Run make install in the build tree. If you are using shared libraries you need
60 to ensure that the library load path on your system includes the appropriate
61 location for the libraries. The default behaviour is to install the libraries
62 to /usr/local/lib (or for cygwin /usr/local/bin). If you are not sure whether
63 this has been done, check your system manual for more information.
67 To be written. Essentially include <GetOpt++/GetOption.h> in main.cc, and
68 <GetOpt++/_foo_Option.h> where you need to declare a command line option.
70 All options must be static variables or static members.