use camino_fs::Utf8PathBuf;
xflags::xflags! {
src "./src/conf/args.rs"
cmd swift-package {
optional --quiet
optional -p, --package package: String
repeated -v, --verbose
optional --unstable-flags unstable_flags: String
optional -r, --release
optional --profile profile: String
repeated -f, --features features: String
optional --all-features
optional --no-default-features
optional --target-dir target_dir: Utf8PathBuf
optional --manifest-path manifest_path: Utf8PathBuf
}
}
#[derive(Debug)]
pub struct SwiftPackage {
pub quiet: bool,
pub package: Option<String>,
pub verbose: u32,
pub unstable_flags: Option<String>,
pub release: bool,
pub profile: Option<String>,
pub features: Vec<String>,
pub all_features: bool,
pub no_default_features: bool,
pub target_dir: Option<Utf8PathBuf>,
pub manifest_path: Option<Utf8PathBuf>,
}
impl SwiftPackage {
#[allow(dead_code)]
pub fn from_env_or_exit() -> Self {
Self::from_env_or_exit_()
}
#[allow(dead_code)]
pub fn from_env() -> xflags::Result<Self> {
Self::from_env_()
}
#[allow(dead_code)]
pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
Self::from_vec_(args)
}
}