appstruct-cli 0.2.0

Command-line compiler and development workflow for AppStruct applications
use clap::ValueEnum;

#[derive(Clone, Copy, Debug, PartialEq, Eq, ValueEnum)]
pub(crate) enum DatabaseMode {
    External,
    Managed,
}

impl DatabaseMode {
    pub(super) const fn name(self) -> &'static str {
        match self {
            Self::External => "external",
            Self::Managed => "managed",
        }
    }
}

#[derive(Clone, Copy, Debug, PartialEq, Eq, ValueEnum)]
pub(crate) enum CapabilityMode {
    #[value(alias = "on", alias = "true")]
    Enabled,
    #[value(alias = "off", alias = "false")]
    Disabled,
}

impl CapabilityMode {
    pub(super) const fn name(self) -> &'static str {
        match self {
            Self::Enabled => "enabled",
            Self::Disabled => "disabled",
        }
    }
}