1 .\" groff -m man -Thtml <file>
2 .\" See groff_www(7), groff(7) and groff_man(7)
4 .\" save current font, switch to monospace font, output, switch back
12 .\" make text on the same line appear alternately in monospace and roman
15 . ds an-result \&\f[CW]\\$1\f[R]\"
17 . while (\\n[.$] >= 2) \{\
18 . as an-result \/\\$1\f[CW]\,\\$2\f[R]\"
21 . if \\n[.$] .as an-result \/\\$1\"
31 .TH lopsub 7 "DATE()" GIT_VERSION()
33 lopsub \- Long option parser for subcommands
38 is an open source library written in
40 which aims to ease the task of creating, documenting and parsing
41 the options of Unix command line utilities. It is suitable for
42 simple commands as well as complex command line utilities with many
43 subcommands where each subcommand has its own set of options. Options
44 and documentation are kept together in a single file which can be
47 code (to be included in the application), or to a manual page.
48 The library supports single-character short options and GNU-style
49 long options. The public API is well documented and stable.
51 To make use of the library, the programmer provides a so-called
53 which describes the options of the application in an intuitive
54 syntax. At build time the suite file is translated into
58 utility which also ships with the
60 package. The generated code defines an instance of an opaque
62 structure and exposes a reference to this structure which can be passed to
65 at run time, together with the usual argument vector. The
66 option parser is part of the
69 so applications need to link with
70 .MONO_ROMAN -llopsub .
71 In addition to the option parser, the library offers many more
72 features. For example, there is a function for merging two different
74 to generate an effective configuration. This is useful for applications
75 which can be configured through command line options and via a
78 The suite file can also be processed into roff format to create
79 a manual page. Conversion into html can easily be performed with
85 .MONO_ROMAN man2html .
88 does not rely on the system's
92 functions of the C library and is thus portable across different
93 flavors of Unix. It is known to work on
102 is licensed under the
106 utility is licensed under the
108 The examples and all code generated by the utilities, however, is
109 licensed with a simple all-permissive license. You are free to do
110 anything you like with the generated code, including incorporating
111 it into or linking it with proprietary software.
117 git clone git://git.tuebingen.mpg.de/lopsub.git
120 Then build the package with
126 The suite parser and the config file parser of the
128 library are both generated by running
130 a tool for generating programs that perform pattern-matching on text. Hence the
132 package must be installed for the build to succeed. Next, run
138 This will install the package in
139 .MONO_ROMAN /usr/local .
140 If you prefer to install as an unprivileged user in
141 .MONO_ROMAN /somewhere/else ,
145 make PREFIX=/somewhere/else install
148 instead. In this case, you need to specify
149 .MONO -I/somewhere/else/include
150 to compile the source files of your application and
151 .MONO -L/somewhere/else/lib
152 for linking. Alternatively, don't run
154 at all and specify the path to the top level directory of the
161 Compile and run the minimal example included at the end of
162 .UR ./lopsub-suite.5.html
169 in the source tree and run the
173 .SH API documentation
175 .UR ./lopsub-api.html
177 Alternatively, examine
180 .MONO_ROMAN lopsub.h.m4 .
184 .MT maan@tuebingen.mpg.de
188 .UR http://people.tuebingen.mpg.de/maan/