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 #![cfg_attr(docsrs, feature(doc_auto_cfg))] 7 #![doc = include_str!("../README.md")] 8 #![doc(html_logo_url = "https://raw.githubusercontent.com/clap-rs/clap/master/assets/clap.png")] 9 #![warn( 10 missing_docs, 11 missing_debug_implementations, 12 missing_copy_implementations, 13 trivial_casts, 14 unused_allocation, 15 trivial_numeric_casts, 16 clippy::single_char_pattern 17 )] 18 #![forbid(unsafe_code)] 19 // Wanting consistency in our calls 20 #![allow(clippy::write_with_newline)] 21 // Gets in the way of logging 22 #![allow(clippy::let_and_return)] 23 // HACK https://github.com/rust-lang/rust-clippy/issues/7290 24 #![allow(clippy::single_component_path_imports)] 25 #![allow(clippy::branches_sharing_code)] 26 // Doesn't allow for debug statements, etc to be unique 27 #![allow(clippy::if_same_then_else)] 28 // Breaks up parallelism that clarifies intent 29 #![allow(clippy::collapsible_else_if)] 30 31 #[cfg(not(feature = "std"))] 32 compile_error!("`std` feature is currently required to build `clap`"); 33 34 pub use crate::builder::ArgAction; 35 pub use crate::builder::Command; 36 pub use crate::builder::ValueHint; 37 pub use crate::builder::{Arg, ArgGroup}; 38 pub use crate::parser::ArgMatches; 39 pub use crate::util::color::ColorChoice; 40 pub use crate::util::Id; 41 42 /// Command Line Argument Parser Error 43 /// 44 /// See [`Command::error`] to create an error. 45 /// 46 /// [`Command::error`]: crate::Command::error 47 pub type Error = crate::error::Error<crate::error::DefaultFormatter>; 48 49 pub use crate::derive::{Args, CommandFactory, FromArgMatches, Parser, Subcommand, ValueEnum}; 50 51 #[macro_use] 52 #[allow(missing_docs)] 53 mod macros; 54 55 mod derive; 56 57 pub mod builder; 58 pub mod error; 59 pub mod parser; 60 61 mod mkeymap; 62 mod output; 63 mod util; 64 65 const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \ 66 report at https://github.com/clap-rs/clap/issues"; 67