]> git.proxmox.com Git - rustc.git/blame - vendor/clap_builder-4.3.10/src/lib.rs
New upstream version 1.73.0+dfsg1
[rustc.git] / vendor / clap_builder-4.3.10 / src / lib.rs
CommitLineData
add651ee
FG
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"))]
32compile_error!("`std` feature is currently required to build `clap`");
33
34pub use crate::builder::ArgAction;
35pub use crate::builder::Command;
36pub use crate::builder::ValueHint;
37pub use crate::builder::{Arg, ArgGroup};
38pub use crate::parser::ArgMatches;
39pub use crate::util::color::ColorChoice;
40pub 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
47pub type Error = crate::error::Error<crate::error::DefaultFormatter>;
48
49pub use crate::derive::{Args, CommandFactory, FromArgMatches, Parser, Subcommand, ValueEnum};
50
51#[doc(hidden)]
52pub mod __macro_refs {
53 #[cfg(feature = "cargo")]
54 #[doc(hidden)]
55 pub use once_cell;
56}
57
58#[macro_use]
59#[allow(missing_docs)]
60mod macros;
61
62mod derive;
63
64pub mod builder;
65pub mod error;
66pub mod parser;
67
68mod mkeymap;
69mod output;
70mod util;
71
72const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \
73 report at https://github.com/clap-rs/clap/issues";