use cfg::Vars;
pub use chroots::{ChrootUnverified, ChrootVerified};
pub use cli::Cli;
pub use idmaps::IDMapItem;
use idmaps::IDMaps;
use indicatif::MultiProgress;
use workspace::Workspace;
mod cfg;
mod chroots;
mod cli;
mod idmaps;
mod progress;
mod workspace;
pub trait LogStatus {}
pub trait ConfigStatus {}
pub struct Globals<T1: LogStatus, T2: ConfigStatus> {
cli: CliOptions,
multi: T1,
cfg: T2,
}
type GlobalsNew = Globals<NotReady, NotReady>;
type GlobalsLogReady = Globals<MultiProgress, NotReady>;
pub type GlobalsFinal = Globals<MultiProgress, ConfigOptions>;
struct CliOptions {
dry_run: bool,
log_level: log::LevelFilter,
}
pub struct NotReady;
impl LogStatus for NotReady {}
impl ConfigStatus for NotReady {}
impl LogStatus for MultiProgress {}
pub struct ConfigOptions {
workspace: Workspace,
config_text: String,
vars: Vars,
idmaps: IDMaps,
}
impl ConfigStatus for ConfigOptions {}
impl<T1: LogStatus, T2: ConfigStatus> Globals<T1, T2> {
#[inline]
pub fn dry_run(&self) -> bool {
self.cli.dry_run
}
}