File: program_options.xml

package info (click to toggle)
boost1.83 1.83.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 545,632 kB
  • sloc: cpp: 3,857,086; xml: 125,552; ansic: 34,414; python: 25,887; asm: 5,276; sh: 4,799; ada: 1,681; makefile: 1,629; perl: 1,212; pascal: 1,139; sql: 810; yacc: 478; ruby: 102; lisp: 24; csh: 6
file content (87 lines) | stat: -rw-r--r-- 3,064 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
     "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<library 
    name="Program_options"
    dirname="program_options" id="program_options" 
    last-revision="$Date$" 
    xmlns:xi="http://www.w3.org/2001/XInclude">
  <libraryinfo>
    <author>
      <firstname>Vladimir</firstname>
      <surname>Prus</surname>
    </author>
    
    <copyright>
      <year>2002</year>
      <year>2003</year>
      <year>2004</year>
      <holder>Vladimir Prus</holder>
    </copyright>

    <legalnotice>
      <para>Distributed under the Boost Software License, Version 1.0.
      (See accompanying file <filename>LICENSE_1_0.txt</filename> or copy at 
      <ulink
      url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>)
      </para>
    </legalnotice>

            
    <librarypurpose>
      Facilities to obtain configuration data from command line, config files
      and other sources</librarypurpose>
    <librarycategory name="category:data-structures"></librarycategory>
  </libraryinfo>
  
  <title>Boost.Program_options</title>
  
  <section>
    <title>Introduction</title>

    <para>The program_options library allows program developers to obtain
    <emphasis>program options</emphasis>, that is (name, value) pairs from the user,
    via conventional methods such as command line and config file.</para>

    <para>Why would you use such a library, and why is it better than parsing
    your command line by straightforward hand-written code?
      <itemizedlist>
        <listitem>
          <para>It's easier. The syntax for declaring options is simple, and
          the library itself is small. Things like conversion of option values to
          desired type and storing into program variables are handled
          automatically.
          </para>
        </listitem>
        <listitem>
          <para>Error reporting is better. All the problems with the command line are
            reported, while hand-written code can just misparse the input. In
            addition, the usage message can be automatically generated, to
            avoid falling out of sync with the real list of options.</para>
        </listitem>
        <listitem>
          <para>Options can be read from anywhere. Sooner or later the command
          line will be not enough for your users, and you'll want config files
          or maybe even environment variables. These can be added without significant 
          effort on your part.
          </para>
        </listitem>        
      </itemizedlist>
    </para>

    <para>
      Now let's see some examples of the library usage in the <xref
      linkend="program_options.tutorial"/>.
    </para>
    
  </section>

  <xi:include href="tutorial.xml"/>  
  <xi:include href="overview.xml"/>  
  
  <xi:include href="howto.xml"/>
  <xi:include href="design.xml"/>
  <xi:include href="acknowledgements.xml"/>    
   
  <xi:include href="autodoc.xml"/> 
</library>