2020-03-02 08:52:15 +00:00
|
|
|
// Copyright ⓒ 2015-2016 Kevin B. Knapp and [`clap-rs` contributors](https://github.com/clap-rs/clap/graphs/contributors).
|
2016-01-31 13:03:09 +00:00
|
|
|
// Licensed under the MIT license
|
|
|
|
// (see LICENSE or <http://opensource.org/licenses/MIT>) All files in the project carrying such
|
|
|
|
// notice may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2020-03-02 08:52:15 +00:00
|
|
|
#![cfg_attr(feature = "doc", feature(external_doc))]
|
2020-05-11 09:15:59 +00:00
|
|
|
#![doc(html_root_url = "https://docs.rs/clap/3.0.0-beta.1")]
|
2020-03-02 08:52:15 +00:00
|
|
|
#![cfg_attr(feature = "doc", doc(include = "../README.md"))]
|
|
|
|
//! https://github.com/clap-rs/clap
|
2017-11-28 12:30:06 +00:00
|
|
|
#![crate_type = "lib"]
|
2019-04-05 19:51:22 +00:00
|
|
|
#![deny(
|
|
|
|
missing_docs,
|
|
|
|
missing_debug_implementations,
|
|
|
|
missing_copy_implementations,
|
|
|
|
trivial_casts,
|
|
|
|
unused_import_braces,
|
|
|
|
unused_allocation,
|
|
|
|
trivial_numeric_casts
|
|
|
|
)]
|
2020-08-20 22:38:40 +00:00
|
|
|
#![forbid(unsafe_code)]
|
2015-08-20 01:44:25 +00:00
|
|
|
|
2020-02-02 01:02:10 +00:00
|
|
|
#[cfg(not(feature = "std"))]
|
2020-03-19 07:17:52 +00:00
|
|
|
compile_error!("`std` feature is currently required to build `clap`");
|
2020-02-02 01:02:10 +00:00
|
|
|
|
2020-04-27 18:47:08 +00:00
|
|
|
pub use crate::{
|
2020-04-07 23:34:53 +00:00
|
|
|
build::{App, AppSettings, Arg, ArgGroup, ArgSettings, ValueHint},
|
2020-04-27 18:47:08 +00:00
|
|
|
parse::errors::{Error, ErrorKind, Result},
|
2020-06-08 13:31:51 +00:00
|
|
|
parse::{ArgMatches, Indices, OsValues, Values},
|
2020-04-27 18:47:08 +00:00
|
|
|
};
|
2020-02-14 16:22:01 +00:00
|
|
|
|
2020-08-11 14:30:02 +00:00
|
|
|
#[cfg(feature = "derive")]
|
|
|
|
pub use crate::derive::{ArgEnum, Clap, FromArgMatches, IntoApp, Subcommand};
|
|
|
|
|
2018-07-23 19:09:42 +00:00
|
|
|
#[cfg(feature = "yaml")]
|
2020-05-15 06:15:25 +00:00
|
|
|
#[cfg_attr(feature = "yaml", doc(hidden))]
|
2018-07-23 19:09:42 +00:00
|
|
|
pub use yaml_rust::YamlLoader;
|
2015-02-25 13:37:25 +00:00
|
|
|
|
2018-07-13 15:36:53 +00:00
|
|
|
#[cfg(feature = "derive")]
|
|
|
|
#[cfg_attr(feature = "derive", doc(hidden))]
|
2019-12-29 15:53:12 +00:00
|
|
|
pub use clap_derive::{self, *};
|
|
|
|
|
2020-08-21 05:21:21 +00:00
|
|
|
#[cfg(any(feature = "derive", feature = "cargo"))]
|
|
|
|
#[doc(hidden)]
|
2019-12-29 15:53:12 +00:00
|
|
|
pub use lazy_static;
|
2018-07-13 15:36:53 +00:00
|
|
|
|
2015-04-10 15:40:08 +00:00
|
|
|
#[macro_use]
|
2020-01-01 17:57:44 +00:00
|
|
|
#[allow(missing_docs)]
|
2020-05-15 07:51:36 +00:00
|
|
|
mod macros;
|
2018-07-26 15:15:47 +00:00
|
|
|
|
2020-08-11 14:30:02 +00:00
|
|
|
#[cfg(feature = "derive")]
|
2020-05-15 07:51:36 +00:00
|
|
|
mod derive;
|
2020-02-08 19:36:00 +00:00
|
|
|
|
2018-07-23 19:09:42 +00:00
|
|
|
mod build;
|
2018-07-19 12:50:47 +00:00
|
|
|
mod mkeymap;
|
2018-07-23 19:09:42 +00:00
|
|
|
mod output;
|
2018-06-12 15:42:03 +00:00
|
|
|
mod parse;
|
|
|
|
mod util;
|
2016-01-11 08:59:56 +00:00
|
|
|
|
2018-11-14 17:12:34 +00:00
|
|
|
const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \
|
2020-02-05 10:04:59 +00:00
|
|
|
report at https://github.com/clap-rs/clap/issues";
|
2018-11-14 17:12:34 +00:00
|
|
|
const INVALID_UTF8: &str = "unexpected invalid UTF-8 code point";
|