2019-09-06 15:57:44 -07:00

61 lines
14 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `clap` mod in crate `structopt`."><meta name="keywords" content="rust, rustlang, rust-lang, clap"><title>structopt::clap - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../structopt/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module clap</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#macros">Macros</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>structopt</a></p><script>window.sidebarCurrent = {name: 'clap', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/structopt/lib.rs.html#511-513' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>structopt</a>::<wbr><a class="mod" href=''>clap</a></span></h1><div class='docblock'><p>Re-export of clap</p>
</div><h2 id='macros' class='section-header'><a href="#macros">Macros</a></h2>
<table><tr class='module-item'><td><a class="macro" href="macro._clap_count_exprs.html" title='structopt::clap::_clap_count_exprs macro'>_clap_count_exprs</a></td><td class='docblock-short'><p>Counts the number of comma-delimited expressions passed to it. The result is a compile-time
evaluable expression, suitable for use as a static array size, or the value of a <code>const</code>.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.app_from_crate.html" title='structopt::clap::app_from_crate macro'>app_from_crate</a></td><td class='docblock-short'><p>Allows you to build the <code>App</code> instance from your Cargo.toml at compile time.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.arg_enum.html" title='structopt::clap::arg_enum macro'>arg_enum</a></td><td class='docblock-short'><p>Convenience macro to generate more complete enums with variants to be used as a type when
parsing arguments. This enum also provides a <code>variants()</code> function which can be used to
retrieve a <code>Vec&lt;&amp;'static str&gt;</code> of the variant names, as well as implementing <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html"><code>FromStr</code></a> and
<a href="https://doc.rust-lang.org/std/fmt/trait.Display.html"><code>Display</code></a> automatically.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.clap_app.html" title='structopt::clap::clap_app macro'>clap_app</a></td><td class='docblock-short'><p>Build <code>App</code>, <code>Arg</code>s, <code>SubCommand</code>s and <code>Group</code>s with Usage-string like input
but without the associated parsing runtime cost.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.crate_authors.html" title='structopt::clap::crate_authors macro'>crate_authors</a></td><td class='docblock-short'><p>Allows you to pull the authors for the app from your Cargo.toml at
compile time in the form:
<code>&quot;author1 lastname &lt;author1@example.com&gt;:author2 lastname &lt;author2@example.com&gt;&quot;</code></p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.crate_description.html" title='structopt::clap::crate_description macro'>crate_description</a></td><td class='docblock-short'><p>Allows you to pull the description from your Cargo.toml at compile time.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.crate_name.html" title='structopt::clap::crate_name macro'>crate_name</a></td><td class='docblock-short'><p>Allows you to pull the name from your Cargo.toml at compile time.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.crate_version.html" title='structopt::clap::crate_version macro'>crate_version</a></td><td class='docblock-short'><p>Allows you to pull the version from your Cargo.toml at compile time as
<code>MAJOR.MINOR.PATCH_PKGVERSION_PRE</code></p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.value_t.html" title='structopt::clap::value_t macro'>value_t</a></td><td class='docblock-short'><p>Convenience macro getting a typed value <code>T</code> where <code>T</code> implements <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html"><code>std::str::FromStr</code></a> from an
argument value. This macro returns a <code>Result&lt;T,String&gt;</code> which allows you as the developer to
decide what you'd like to do on a failed parse. There are two types of errors, parse failures
and those where the argument wasn't present (such as a non-required argument). You can use
it to get a single value, or a iterator as with the <a href="./struct.ArgMatches.html#method.values_of"><code>ArgMatches::values_of</code></a></p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.value_t_or_exit.html" title='structopt::clap::value_t_or_exit macro'>value_t_or_exit</a></td><td class='docblock-short'><p>Convenience macro getting a typed value <code>T</code> where <code>T</code> implements <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html"><code>std::str::FromStr</code></a> or
exiting upon error, instead of returning a <a href="https://doc.rust-lang.org/std/result/enum.Result.html"><code>Result</code></a> type.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.values_t.html" title='structopt::clap::values_t macro'>values_t</a></td><td class='docblock-short'><p>Convenience macro getting a typed value <a href="https://doc.rust-lang.org/std/vec/struct.Vec.html"><code>Vec&lt;T&gt;</code></a> where <code>T</code> implements <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html"><code>std::str::FromStr</code></a>
This macro returns a <a href="./type.Result.html"><code>clap::Result&lt;Vec&lt;T&gt;&gt;</code></a> which allows you as the developer to decide
what you'd like to do on a failed parse.</p>
</td></tr><tr class='module-item'><td><a class="macro" href="macro.values_t_or_exit.html" title='structopt::clap::values_t_or_exit macro'>values_t_or_exit</a></td><td class='docblock-short'><p>Convenience macro getting a typed value <a href="https://doc.rust-lang.org/std/vec/struct.Vec.html"><code>Vec&lt;T&gt;</code></a> where <code>T</code> implements <a href="https://doc.rust-lang.org/std/str/trait.FromStr.html"><code>std::str::FromStr</code></a>
or exiting upon error.</p>
</td></tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table><tr class='module-item'><td><a class="struct" href="struct.App.html" title='structopt::clap::App struct'>App</a></td><td class='docblock-short'><p>Used to create a representation of a command line program and all possible command line
arguments. Application settings are set using the &quot;builder pattern&quot; with the
<a href="./struct.App.html#method.get_matches"><code>App::get_matches</code></a> family of methods being the terminal methods that starts the
runtime-parsing process. These methods then return information about the user supplied
arguments (or lack there of).</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Arg.html" title='structopt::clap::Arg struct'>Arg</a></td><td class='docblock-short'><p>The abstract representation of a command line argument. Used to set all the options and
relationships that define a valid argument for the program.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ArgGroup.html" title='structopt::clap::ArgGroup struct'>ArgGroup</a></td><td class='docblock-short'><p><code>ArgGroup</code>s are a family of related <a href="./struct.Arg.html">arguments</a> and way for you to express, &quot;Any of these
arguments&quot;. By placing arguments in a logical group, you can create easier requirement and
exclusion rules instead of having to list each argument individually, or when you want a rule
to apply &quot;any but not all&quot; arguments.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.ArgMatches.html" title='structopt::clap::ArgMatches struct'>ArgMatches</a></td><td class='docblock-short'><p>Used to get information about the arguments that where supplied to the program at runtime by
the user. New instances of this struct are obtained by using the <a href="./struct.App.html#method.get_matches"><code>App::get_matches</code></a> family of
methods.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Error.html" title='structopt::clap::Error struct'>Error</a></td><td class='docblock-short'><p>Command Line Argument Parser Error</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.OsValues.html" title='structopt::clap::OsValues struct'>OsValues</a></td><td class='docblock-short'><p>An iterator for getting multiple values out of an argument via the [<code>ArgMatches::values_of_os</code>]
method. Usage of this iterator allows values which contain invalid UTF-8 code points unlike
[<code>Values</code>].</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.SubCommand.html" title='structopt::clap::SubCommand struct'>SubCommand</a></td><td class='docblock-short'><p>The abstract representation of a command line subcommand.</p>
</td></tr><tr class='module-item'><td><a class="struct" href="struct.Values.html" title='structopt::clap::Values struct'>Values</a></td><td class='docblock-short'><p>An iterator for getting multiple values out of an argument via the <a href="./struct.ArgMatches.html#method.values_of"><code>ArgMatches::values_of</code></a>
method.</p>
</td></tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table><tr class='module-item'><td><a class="enum" href="enum.AppSettings.html" title='structopt::clap::AppSettings enum'>AppSettings</a></td><td class='docblock-short'><p>Application level settings, which affect how <a href="./struct.App.html"><code>App</code></a> operates</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ArgSettings.html" title='structopt::clap::ArgSettings enum'>ArgSettings</a></td><td class='docblock-short'><p>Various settings that apply to arguments and may be set, unset, and checked via getter/setter
methods <a href="./struct.Arg.html#method.set"><code>Arg::set</code></a>, <a href="./struct.Arg.html#method.unset"><code>Arg::unset</code></a>, and <a href="./struct.Arg.html#method.is_set"><code>Arg::is_set</code></a></p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.ErrorKind.html" title='structopt::clap::ErrorKind enum'>ErrorKind</a></td><td class='docblock-short'><p>Command line argument parser kind of error</p>
</td></tr><tr class='module-item'><td><a class="enum" href="enum.Shell.html" title='structopt::clap::Shell enum'>Shell</a></td><td class='docblock-short'><p>Describes which shell to produce a completions file for</p>
</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
<table><tr class='module-item'><td><a class="type" href="type.Result.html" title='structopt::clap::Result type'>Result</a></td><td class='docblock-short'><p>Short hand for <a href="https://doc.rust-lang.org/std/result/enum.Result.html"><code>Result</code></a> type</p>
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd></kbd></dt><dd>Move up in search results</dd><dt><kbd></kbd></dt><dd>Move down in search results</dd><dt><kbd></kbd></dt><dd>Switch tab</dd><dt><kbd>&#9166;</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "structopt";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>