diff --git a/src/build/app.rs b/src/build/app.rs index fd5474f1..77c87ebd 100644 --- a/src/build/app.rs +++ b/src/build/app.rs @@ -16,7 +16,6 @@ use yaml_rust::Yaml; // Internal use crate::build::app_settings::{AppFlags, AppSettings}; -use crate::build::debug_asserts::assert_app; use crate::build::{arg::ArgProvider, Arg, ArgGroup, ArgPredicate}; use crate::error::ErrorKind; use crate::error::Result as ClapResult; @@ -26,6 +25,9 @@ use crate::parse::{ArgMatcher, ArgMatches, Input, Parser}; use crate::util::{color::ColorChoice, Id, Key}; use crate::{Error, INTERNAL_ERROR_MSG}; +#[cfg(debug_assertions)] +use crate::build::debug_asserts::assert_app; + /// Build a command-line interface. /// /// This includes defining arguments, subcommands, parser behavior, and help output. diff --git a/src/build/arg/mod.rs b/src/build/arg.rs similarity index 99% rename from src/build/arg/mod.rs rename to src/build/arg.rs index b3433213..fd0f81a6 100644 --- a/src/build/arg/mod.rs +++ b/src/build/arg.rs @@ -1,15 +1,3 @@ -mod arg_predicate; -mod possible_value; -mod settings; -#[cfg(test)] -mod tests; -mod value_hint; - -pub use self::possible_value::PossibleValue; -pub use self::settings::{ArgFlags, ArgSettings}; -pub use self::value_hint::ValueHint; -pub(crate) use arg_predicate::ArgPredicate; - // Std use std::{ borrow::Cow, @@ -27,17 +15,16 @@ use std::{env, ffi::OsString}; use yaml_rust::Yaml; // Internal -use crate::{ - build::usage_parser::UsageParser, - util::{Id, Key}, - INTERNAL_ERROR_MSG, -}; +use crate::build::usage_parser::UsageParser; +use crate::build::ArgPredicate; +use crate::util::{Id, Key}; +use crate::PossibleValue; +use crate::ValueHint; +use crate::INTERNAL_ERROR_MSG; +use crate::{ArgFlags, ArgSettings}; #[cfg(feature = "regex")] -mod regex; - -#[cfg(feature = "regex")] -pub use self::regex::RegexRef; +use crate::build::RegexRef; /// The abstract representation of a command line argument. Used to set all the options and /// relationships that define a valid argument for the program. diff --git a/src/build/arg/arg_predicate.rs b/src/build/arg_predicate.rs similarity index 100% rename from src/build/arg/arg_predicate.rs rename to src/build/arg_predicate.rs diff --git a/src/build/arg/settings.rs b/src/build/arg_settings.rs similarity index 100% rename from src/build/arg/settings.rs rename to src/build/arg_settings.rs diff --git a/src/build/arg/tests.rs b/src/build/arg_tests.rs similarity index 100% rename from src/build/arg/tests.rs rename to src/build/arg_tests.rs diff --git a/src/build/mod.rs b/src/build/mod.rs index 2c1dd0fe..06ccb7a8 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -6,16 +6,31 @@ pub mod arg; mod app_settings; mod arg_group; +mod arg_predicate; +mod arg_settings; +mod possible_value; mod usage_parser; +mod value_hint; + +#[cfg(feature = "regex")] +mod regex; #[cfg(debug_assertions)] mod debug_asserts; #[cfg(test)] mod app_tests; +#[cfg(test)] +mod arg_tests; -pub use self::app::App; -pub use self::app_settings::{AppFlags, AppSettings}; -pub use self::arg::{Arg, ArgFlags, ArgSettings, PossibleValue, ValueHint}; -pub use self::arg_group::ArgGroup; -pub(crate) use arg::ArgPredicate; +pub use app::App; +pub use app_settings::{AppFlags, AppSettings}; +pub use arg::Arg; +pub use arg_group::ArgGroup; +pub(crate) use arg_predicate::ArgPredicate; +pub use arg_settings::{ArgFlags, ArgSettings}; +pub use possible_value::PossibleValue; +pub use value_hint::ValueHint; + +#[cfg(feature = "regex")] +pub use self::regex::RegexRef; diff --git a/src/build/arg/possible_value.rs b/src/build/possible_value.rs similarity index 100% rename from src/build/arg/possible_value.rs rename to src/build/possible_value.rs diff --git a/src/build/arg/regex.rs b/src/build/regex.rs similarity index 100% rename from src/build/arg/regex.rs rename to src/build/regex.rs diff --git a/src/build/arg/value_hint.rs b/src/build/value_hint.rs similarity index 100% rename from src/build/arg/value_hint.rs rename to src/build/value_hint.rs diff --git a/src/lib.rs b/src/lib.rs index 792614fd..9a48ae86 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,7 +65,7 @@ mod macros; mod derive; #[cfg(feature = "regex")] -pub use crate::build::arg::RegexRef; +pub use crate::build::RegexRef; pub mod error; diff --git a/src/parse/validator.rs b/src/parse/validator.rs index 4a23c5e8..c2694ba4 100644 --- a/src/parse/validator.rs +++ b/src/parse/validator.rs @@ -1,5 +1,5 @@ // Internal -use crate::build::{arg::PossibleValue, App, AppSettings as AS, Arg, ArgPredicate}; +use crate::build::{App, AppSettings as AS, Arg, ArgPredicate, PossibleValue}; use crate::error::{Error, Result as ClapResult}; use crate::output::Usage; use crate::parse::{ArgMatcher, MatchedArg, ParseState, Parser};