minor tweaks

This commit is contained in:
mes5k 2004-10-30 22:47:44 +00:00
parent 5b62676a6b
commit caa007d6e9
3 changed files with 29 additions and 26 deletions

View File

@ -144,8 +144,8 @@ work.</li><li>If there is an error parsing the command line (e.g. a required
argument isn't provided), the program exits and displays a brief argument isn't provided), the program exits and displays a brief
USAGE and an error message.</li><li>The program name is assumed to always be argv[0], so it isn't USAGE and an error message.</li><li>The program name is assumed to always be argv[0], so it isn't
specified directly.</li><li>A delimiter character can be specified. This means that if you specified directly.</li><li>A delimiter character can be specified. This means that if you
prefer arguments of the style &quot;-s=asdf&quot; instead of &quot;-s asdf&quot;, you prefer arguments of the style <i class="parameter"><tt>-s=asdf</tt></i> instead of
can do so.</li><li><span class="emphasis"><em>Always wrap everything in a try block that catches <i class="parameter"><tt>-s asdf</tt></i>, you can do so.</li><li><span class="emphasis"><em>Always wrap everything in a try block that catches
ArgExceptions!</em></span> Any problems found in constructing the ArgExceptions!</em></span> Any problems found in constructing the
<tt class="classname">CmdLine</tt> or the <tt class="classname">Arg</tt>s will <tt class="classname">CmdLine</tt> or the <tt class="classname">Arg</tt>s will
throw an <tt class="classname">ArgException</tt>.</li></ul></div><p> throw an <tt class="classname">ArgException</tt>.</li></ul></div><p>
@ -155,7 +155,7 @@ These properties are set in the constructors of the arguments.
</p><div class="itemizedlist"><ul type="disc"><li>First is the flag or the character preceeded by a dash(-) that </p><div class="itemizedlist"><ul type="disc"><li>First is the flag or the character preceeded by a dash(-) that
signals the beginning of the argument on the command line.</li><li>Arguments also have names, which can, if desired also be used signals the beginning of the argument on the command line.</li><li>Arguments also have names, which can, if desired also be used
as a flag on the command line, this time preceeded by two dashes as a flag on the command line, this time preceeded by two dashes
(--) [like the familiar getopt_long()].</li><li>Next is the description of the argument. This is a short (--) [like the familiar <tt class="function">getopt_long()</tt>].</li><li>Next is the description of the argument. This is a short
description of the argument displayed in the help/usage message description of the argument displayed in the help/usage message
when needed.</li><li>The boolean value in <tt class="classname">ValueArg</tt>s when needed.</li><li>The boolean value in <tt class="classname">ValueArg</tt>s
indicates whether the indicates whether the
@ -226,7 +226,7 @@ to work on Windows, Sun and Alpha platforms. We've made every
effort to keep the library compliant with the ANSI C++ standard so effort to keep the library compliant with the ANSI C++ standard so
if your compiler meets the standard, then this library should work if your compiler meets the standard, then this library should work
for you. Please let us know if this is not the case! for you. Please let us know if this is not the case!
</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2853418"></a>Windows Note</h3></div></div><div></div></div><p> </p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2853439"></a>Windows Note</h3></div></div><div></div></div><p>
As we understand things, Visual C++ does not have the file As we understand things, Visual C++ does not have the file
<tt class="filename">config.h</tt> which is used to make platform <tt class="filename">config.h</tt> which is used to make platform
specific definitions. In this situation, we assume that you specific definitions. In this situation, we assume that you
@ -411,13 +411,14 @@ This is called &quot;exclusive or&quot; or &quot;XOR&quot;. To accomodate this
situation, there is now an option to add two or more situation, there is now an option to add two or more
<tt class="classname">Arg</tt>s to <tt class="classname">Arg</tt>s to
a <tt class="classname">CmdLine</tt> that are exclusively or'd with one another: a <tt class="classname">CmdLine</tt> that are exclusively or'd with one another:
xorAdd(). This means that exactly one of the <tt class="methodname">xorAdd()</tt>. This means that exactly one of the
<tt class="classname">Arg</tt>s must be set and no more. <tt class="classname">Arg</tt>s must be set and no more.
</p><p> </p><p>
xorAdd() comes in two flavors, either xorAdd(Arg&amp; a, Arg&amp; b) <tt class="methodname">xorAdd()</tt> comes in two flavors, either
<tt class="methodname">xorAdd(Arg&amp; a, Arg&amp; b)</tt>
to add just two <tt class="classname">Arg</tt>s to be xor'd and to add just two <tt class="classname">Arg</tt>s to be xor'd and
xorAdd( vector&lt;Arg*&gt; xorList ) to add more than two <tt class="methodname">xorAdd( vector&lt;Arg*&gt; xorList )</tt>
<tt class="classname">Arg</tt>s. to add more than two <tt class="classname">Arg</tt>s.
</p><pre class="programlisting"> </p><pre class="programlisting">
@ -438,10 +439,11 @@ marked as set. The question then, is how to determine which of the
<tt class="classname">Arg</tt>s has been set? This is accomplished by calling the <tt class="classname">Arg</tt>s has been set? This is accomplished by calling the
isSet() method for each <tt class="classname">Arg</tt>. If the isSet() method for each <tt class="classname">Arg</tt>. If the
<tt class="classname">Arg</tt> has been <tt class="classname">Arg</tt> has been
matched on the command line, the isSet() will return matched on the command line, the <tt class="methodname">isSet()</tt> will return
<tt class="constant">TRUE</tt>, whereas if the <tt class="classname">Arg</tt> <tt class="constant">TRUE</tt>, whereas if the <tt class="classname">Arg</tt>
has been set as a result of matching the other <tt class="classname">Arg</tt> has been set as a result of matching the other <tt class="classname">Arg</tt>
that was xor'd isSet() will return <tt class="constant">FALSE</tt>. that was xor'd <tt class="methodname">isSet()</tt> will
return <tt class="constant">FALSE</tt>.
(Of course, if the <tt class="classname">Arg</tt> was not xor'd and (Of course, if the <tt class="classname">Arg</tt> was not xor'd and
wasn't matched, it will also return <tt class="constant">FALSE</tt>.) wasn't matched, it will also return <tt class="constant">FALSE</tt>.)
@ -508,7 +510,8 @@ be relatively small, although there is no limit on this.
Obviously, a list of allowed values isn't always the best way to Obviously, a list of allowed values isn't always the best way to
constrain things. For instance, one might wish to allow only constrain things. For instance, one might wish to allow only
integers greater than 0. In this case, the best strategy is for you integers greater than 0. In this case, the best strategy is for you
to evaluate the value returned from the getValue() call and if it to evaluate the value returned from the <tt class="methodname">getValue()</tt>
call and if it
isn't valid, throw an <tt class="classname">ArgException</tt>. Be sure that the isn't valid, throw an <tt class="classname">ArgException</tt>. Be sure that the
description provided with the <tt class="classname">Arg</tt> reflects description provided with the <tt class="classname">Arg</tt> reflects
the constraint you choose. the constraint you choose.

View File

@ -192,8 +192,8 @@ USAGE and an error message.</listitem>
specified directly.</listitem> specified directly.</listitem>
<listitem>A delimiter character can be specified. This means that if you <listitem>A delimiter character can be specified. This means that if you
prefer arguments of the style "-s=asdf" instead of "-s asdf", you prefer arguments of the style <parameter>-s=asdf</parameter> instead of
can do so.</listitem> <parameter>-s asdf</parameter>, you can do so.</listitem>
<listitem><emphasis>Always wrap everything in a try block that catches <listitem><emphasis>Always wrap everything in a try block that catches
ArgExceptions!</emphasis> Any problems found in constructing the ArgExceptions!</emphasis> Any problems found in constructing the
@ -214,7 +214,7 @@ signals the beginning of the argument on the command line.</listitem>
<listitem>Arguments also have names, which can, if desired also be used <listitem>Arguments also have names, which can, if desired also be used
as a flag on the command line, this time preceeded by two dashes as a flag on the command line, this time preceeded by two dashes
(--) [like the familiar getopt_long()].</listitem> (--) [like the familiar <function>getopt_long()</function>].</listitem>
<listitem>Next is the description of the argument. This is a short <listitem>Next is the description of the argument. This is a short
description of the argument displayed in the help/usage message description of the argument displayed in the help/usage message
@ -540,15 +540,16 @@ This is called "exclusive or" or "XOR". To accomodate this
situation, there is now an option to add two or more situation, there is now an option to add two or more
<classname>Arg</classname>s to <classname>Arg</classname>s to
a <classname>CmdLine</classname> that are exclusively or'd with one another: a <classname>CmdLine</classname> that are exclusively or'd with one another:
xorAdd(). This means that exactly one of the <methodname>xorAdd()</methodname>. This means that exactly one of the
<classname>Arg</classname>s must be set and no more. <classname>Arg</classname>s must be set and no more.
</para> </para>
<para> <para>
xorAdd() comes in two flavors, either xorAdd(Arg&amp; a, Arg&amp; b) <methodname>xorAdd()</methodname> comes in two flavors, either
<methodname>xorAdd(Arg&amp; a, Arg&amp; b)</methodname>
to add just two <classname>Arg</classname>s to be xor'd and to add just two <classname>Arg</classname>s to be xor'd and
xorAdd( vector&lt;Arg*&gt; xorList ) to add more than two <methodname>xorAdd( vector&lt;Arg*&gt; xorList )</methodname>
<classname>Arg</classname>s. to add more than two <classname>Arg</classname>s.
<programlisting> <programlisting>
@ -569,10 +570,11 @@ marked as set. The question then, is how to determine which of the
<classname>Arg</classname>s has been set? This is accomplished by calling the <classname>Arg</classname>s has been set? This is accomplished by calling the
isSet() method for each <classname>Arg</classname>. If the isSet() method for each <classname>Arg</classname>. If the
<classname>Arg</classname> has been <classname>Arg</classname> has been
matched on the command line, the isSet() will return matched on the command line, the <methodname>isSet()</methodname> will return
<constant>TRUE</constant>, whereas if the <classname>Arg</classname> <constant>TRUE</constant>, whereas if the <classname>Arg</classname>
has been set as a result of matching the other <classname>Arg</classname> has been set as a result of matching the other <classname>Arg</classname>
that was xor'd isSet() will return <constant>FALSE</constant>. that was xor'd <methodname>isSet()</methodname> will
return <constant>FALSE</constant>.
(Of course, if the <classname>Arg</classname> was not xor'd and (Of course, if the <classname>Arg</classname> was not xor'd and
wasn't matched, it will also return <constant>FALSE</constant>.) wasn't matched, it will also return <constant>FALSE</constant>.)
@ -653,7 +655,8 @@ be relatively small, although there is no limit on this.
Obviously, a list of allowed values isn't always the best way to Obviously, a list of allowed values isn't always the best way to
constrain things. For instance, one might wish to allow only constrain things. For instance, one might wish to allow only
integers greater than 0. In this case, the best strategy is for you integers greater than 0. In this case, the best strategy is for you
to evaluate the value returned from the getValue() call and if it to evaluate the value returned from the <methodname>getValue()</methodname>
call and if it
isn't valid, throw an <classname>ArgException</classname>. Be sure that the isn't valid, throw an <classname>ArgException</classname>. Be sure that the
description provided with the <classname>Arg</classname> reflects description provided with the <classname>Arg</classname> reflects
the constraint you choose. the constraint you choose.
@ -752,7 +755,8 @@ heart's content.
<para> <para>
Ideally this library would use RTTI to return a human readable name Ideally this library would use RTTI to return a human readable name
of the type declared for a particular argument. Unfortunately, at of the type declared for a particular argument. Unfortunately, at
least for g++, the names returned aren't particularly useful. least for <command>g++</command>, the names returned aren't
particularly useful.
</para> </para>
</sect1> </sect1>
</chapter> </chapter>

View File

@ -86,13 +86,9 @@ tt.classname {
} }
tt.constant { tt.constant {
font-style:italic;
font-weight:bold; font-weight:bold;
} }
tt.methodname {
font-style:italic;
}
p { p {
line-height: 1.5em; line-height: 1.5em;