refactor: Flatten directory heirarchy

This commit is contained in:
Ed Page 2022-02-10 11:07:57 -06:00
parent 727c453322
commit b7842c2e11
5 changed files with 16 additions and 16 deletions

View file

@ -1,11 +1,3 @@
#[cfg(debug_assertions)]
mod debug_asserts;
mod settings;
#[cfg(test)]
mod tests;
pub use self::settings::{AppFlags, AppSettings};
// Std // Std
use std::{ use std::{
collections::HashMap, collections::HashMap,
@ -23,6 +15,8 @@ use os_str_bytes::RawOsStr;
use yaml_rust::Yaml; use yaml_rust::Yaml;
// Internal // 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::build::{arg::ArgProvider, Arg, ArgGroup, ArgPredicate};
use crate::error::ErrorKind; use crate::error::ErrorKind;
use crate::error::Result as ClapResult; use crate::error::Result as ClapResult;
@ -2802,14 +2796,14 @@ impl<'help> App<'help> {
self.args._build(); self.args._build();
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
self::debug_asserts::assert_app(self); assert_app(self);
self.settings.set(AppSettings::Built); self.settings.set(AppSettings::Built);
} else { } else {
debug!("App::_build: already built"); debug!("App::_build: already built");
} }
} }
fn _panic_on_missing_help(&self, help_required_globally: bool) { pub(crate) fn _panic_on_missing_help(&self, help_required_globally: bool) {
if self.is_set(AppSettings::HelpExpected) || help_required_globally { if self.is_set(AppSettings::HelpExpected) || help_required_globally {
let args_missing_help: Vec<String> = self let args_missing_help: Vec<String> = self
.args .args
@ -2831,7 +2825,7 @@ impl<'help> App<'help> {
} }
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
fn two_args_of<F>(&self, condition: F) -> Option<(&Arg<'help>, &Arg<'help>)> pub(crate) fn two_args_of<F>(&self, condition: F) -> Option<(&Arg<'help>, &Arg<'help>)>
where where
F: Fn(&Arg) -> bool, F: Fn(&Arg) -> bool,
{ {

View file

@ -4,12 +4,18 @@ mod macros;
pub mod app; pub mod app;
pub mod arg; pub mod arg;
mod app_settings;
mod arg_group; mod arg_group;
mod usage_parser; mod usage_parser;
pub use self::{ #[cfg(debug_assertions)]
app::{App, AppFlags, AppSettings}, mod debug_asserts;
arg::{Arg, ArgFlags, ArgSettings, PossibleValue, ValueHint},
arg_group::ArgGroup, #[cfg(test)]
}; mod app_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(crate) use arg::ArgPredicate;