<ul>
<li><a href="#cl::ParseCommandLineOptions">The
<tt>cl::ParseCommandLineOptions</tt> function</a>
+ <li><a href="#cl::ParseEnvironmentOptions">The
+ <tt>cl::ParseEnvironmentOptions</tt> function</a>
<li><a href="#cl::opt">The <tt>cl::opt</tt> class</a>
<li><a href="#cl::list">The <tt>cl::list</tt> class</a>
<li><a href="#cl::alias">The <tt>cl::alias</tt> class</a>
<pre>
bool DebugFlag; <i>// the actual value</i>
-static <a href="#cl::opt">cl::opt</a><bool, true> <i>// The parser</i>
+static <a href="#cl::opt">cl::opt</a><bool, true> <i>// The parser</i>
Debug("<i>debug</i>", <a href="#cl::desc">cl::desc</a>("<i>Enable debug output</i>")</a>, <a href="#cl::Hidden">cl::Hidden</a>,
<a href="#cl::location">cl::location</a>(DebugFlag));
</pre>
<li><a name="cl::init">The <b><tt>cl::init</tt></b> attribute specifies an
inital value for a <a href="#cl::opt">scalar</a> option. If this attribute is
not specified then the command line option value defaults to the value created
-by the default constructor for the type.<p>
+by the default constructor for the type. <b>Warning</b>: If you specify both
+<b><tt>cl::init</tt></b> and <b><tt>cl::location</tt></b> for an option,
+you must specify <b><tt>cl::location</tt></b> first, so that when the
+command-line parser sees <b><tt>cl::init</tt></b>, it knows where to put the
+initial value. (You will get an error at runtime if you don't put them in
+the right order.)<p>
<li><a name="cl::location">The <b><tt>cl::location</tt></b> attribute where to
store the value for a parsed command line option if using external storage. See
<a name="cl::Prefix">The <b><tt>cl::Prefix</tt></b> modifier specifies that this
option prefixes its value. With 'Prefix' options, there is no equal sign that
-seperates the value from the option name specified. This is useful for
+separates the value from the option name specified. This is useful for
processing odd arguments like '<tt>-lmalloc -L/usr/lib'</tt> in a linker tool.
Here, the '<tt>l</tt>' and '<tt>L</tt>' options are normal string (list)
options, that have the <a href="#cl::Prefix">cl::Prefix</a> modifier added to
<tt>--help</tt> option is invoked.<p>
+<!-- _______________________________________________________________________ -->
+</ul><a name="cl::ParseEnvironmentOptions"><h4><hr size=0>The
+<tt>cl::ParseEnvironmentOptions</tt> function</h4><ul>
+
+The <tt>cl::ParseEnvironmentOptions</tt>
+function has mostly the same effects as
+<a href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>,
+except that it is designed to take values for options from an
+environment variable, for those cases in which reading the
+command line is not convenient or not desired. It fills in
+the values of all the command line option variables just like
+<a href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>
+does.<p>
+
+It takes three parameters: first, the name of the program (since <tt>argv</tt>
+may not be available, it can't just look in <tt>argv[0]</tt>), second,
+the name of the environment variable to examine, and third, the optional
+<a href="#description">additional extra text</a> to emit when the
+<tt>--help</tt> option is invoked.<p>
+
+<tt>cl::ParseEnvironmentOptions</tt> will break the environment
+variable's value up into words and then process them using
+<a href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>.
+<b>Note:</b> Currently <tt>cl::ParseEnvironmentOptions</tt> does not support
+quoting, so an environment variable containing <tt>-option "foo bar"</tt> will
+be parsed as three words, <tt>-option</tt>, <tt>"foo</tt>, and <tt>bar"</tt>,
+which is different from what you would get from the shell with the same
+input.<p>
+
<!-- _______________________________________________________________________ -->
</ul><a name="cl::opt"><h4><hr size=0>The <tt>cl::opt</tt> class</h4><ul>
doesn't work if your fundemental data type is something that is already
supported.<p>
-<li>Write an independant class, using it explicitly from options that need
+<li>Write an independent class, using it explicitly from options that need
it.<p>
This approach works well in situations where you would line to parse an
<address><a href="mailto:sabre@nondot.org">Chris Lattner</a></address>
<!-- Created: Tue Jan 23 15:19:28 CST 2001 -->
<!-- hhmts start -->
-Last modified: Sat Jun 21 16:45:29 CDT 2003
+Last modified: Fri Aug 1 16:30:11 CDT 2003
<!-- hhmts end -->
</font>
</body></html>