program_options.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  3. "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
  4. <library
  5. name="Program_options"
  6. dirname="program_options" id="program_options"
  7. last-revision="$Date$"
  8. xmlns:xi="http://www.w3.org/2001/XInclude">
  9. <libraryinfo>
  10. <author>
  11. <firstname>Vladimir</firstname>
  12. <surname>Prus</surname>
  13. </author>
  14. <copyright>
  15. <year>2002</year>
  16. <year>2003</year>
  17. <year>2004</year>
  18. <holder>Vladimir Prus</holder>
  19. </copyright>
  20. <legalnotice>
  21. <para>Distributed under the Boost Software License, Version 1.0.
  22. (See accompanying file <filename>LICENSE_1_0.txt</filename> or copy at
  23. <ulink
  24. url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>)
  25. </para>
  26. </legalnotice>
  27. <librarypurpose>
  28. Facilities to obtain configuration data from command line, config files
  29. and other sources</librarypurpose>
  30. <librarycategory name="category:data-structures"></librarycategory>
  31. </libraryinfo>
  32. <title>Boost.Program_options</title>
  33. <section>
  34. <title>Introduction</title>
  35. <para>The program_options library allows program developers to obtain
  36. <emphasis>program options</emphasis>, that is (name, value) pairs from the user,
  37. via conventional methods such as command line and config file.</para>
  38. <para>Why would you use such a library, and why is it better than parsing
  39. your command line by straightforward hand-written code?
  40. <itemizedlist>
  41. <listitem>
  42. <para>It's easier. The syntax for declaring options is simple, and
  43. the library itself is small. Things like conversion of option values to
  44. desired type and storing into program variables are handled
  45. automatically.
  46. </para>
  47. </listitem>
  48. <listitem>
  49. <para>Error reporting is better. All the problems with the command line are
  50. reported, while hand-written code can just misparse the input. In
  51. addition, the usage message can be automatically generated, to
  52. avoid falling out of sync with the real list of options.</para>
  53. </listitem>
  54. <listitem>
  55. <para>Options can be read from anywhere. Sooner or later the command
  56. line will be not enough for your users, and you'll want config files
  57. or maybe even environment variables. These can be added without significant
  58. effort on your part.
  59. </para>
  60. </listitem>
  61. </itemizedlist>
  62. </para>
  63. <para>
  64. Now let's see some examples of the library usage in the <xref
  65. linkend="program_options.tutorial"/>.
  66. </para>
  67. </section>
  68. <xi:include href="tutorial.xml"/>
  69. <xi:include href="overview.xml"/>
  70. <xi:include href="howto.xml"/>
  71. <xi:include href="design.xml"/>
  72. <xi:include href="acknowledgements.xml"/>
  73. <xi:include href="autodoc.xml"/>
  74. </library>