mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
refactor: Flatten directory heirarchy
This commit is contained in:
parent
fb9e4e7c25
commit
60a8747603
11 changed files with 33 additions and 29 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in a new issue