clap_builder/
lib.rs

1// Copyright ⓒ 2015-2016 Kevin B. Knapp and [`clap-rs` contributors](https://github.com/clap-rs/clap/graphs/contributors).
2// Licensed under the MIT license
3// (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such
4// notice may not be copied, modified, or distributed except according to those terms.
5
6#![doc = include_str!("../README.md")]
7#![doc(html_logo_url = "https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png")]
8#![cfg_attr(docsrs, feature(doc_auto_cfg))]
9#![forbid(unsafe_code)]
10#![warn(missing_docs)]
11#![warn(clippy::print_stderr)]
12#![warn(clippy::print_stdout)]
13
14#[cfg(not(feature = "std"))]
15compile_error!("`std` feature is currently required to build `clap`");
16
17pub use crate::builder::ArgAction;
18pub use crate::builder::Command;
19pub use crate::builder::ValueHint;
20pub use crate::builder::{Arg, ArgGroup};
21pub use crate::parser::ArgMatches;
22pub use crate::util::color::ColorChoice;
23pub use crate::util::Id;
24
25/// Command Line Argument Parser Error
26///
27/// See [`Command::error`] to create an error.
28///
29/// [`Command::error`]: crate::Command::error
30pub type Error = error::Error<error::DefaultFormatter>;
31
32pub use crate::derive::{Args, CommandFactory, FromArgMatches, Parser, Subcommand, ValueEnum};
33
34#[macro_use]
35#[allow(missing_docs)]
36mod macros;
37
38mod derive;
39
40pub mod builder;
41pub mod error;
42pub mod parser;
43
44mod mkeymap;
45mod output;
46mod util;
47
48const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \
49                                  report at https://github.com/clap-rs/clap/issues";