]> cygwin.com Git - cygwin-apps/setup.git/blob - libgetopt++/README
Implement paired boolean options
[cygwin-apps/setup.git] / libgetopt++ / README
1 This is the README for libgetopt++. Libgetopt++ is a C++ library for command
2 line parsing.
3
4 It has/allows:
5
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
13 unit scope.
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.
18
19 Libgetopt++ is licenced under the GPL.
20
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
24 and help requests.
25
26 Getting libgetopt++:
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++.
30
31 Building 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.
36
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.
40
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.
45
46 For libgetopt++ users:
47 You only need a C++ compiler toolchain. The user distributions include a
48 pregenerated configure script.
49
50 Once you have that,
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
56 5) run make.
57
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.
64
65 Using libgetopt++:
66
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.
69
70 All options must be static variables or static members.
71
72
This page took 0.038517 seconds and 5 git commands to generate.