euv-cli 0.47.0

Cross-platform CLI tool for the euv native UI framework supporting run, build, check, fmt, doctor, new, and Hyperlane SSE dynamic updates across all supported platforms.
Documentation
use super::*;

/// Conversion helpers between CLI arguments and `euv-core` types.
impl RenderArg {
    /// Converts a `RenderArg` into the core `RenderMode` enum.
    ///
    /// # Returns
    ///
    /// - `RenderMode` - Core rendering pipeline mode.
    #[must_use]
    pub const fn to_render_mode(self) -> RenderMode {
        match self {
            Self::Auto => RenderMode::Auto,
            Self::Software => RenderMode::Software,
            Self::Hardware => RenderMode::Hardware,
            Self::Hybrid => RenderMode::Hybrid,
        }
    }

    /// Returns the CLI flag string forwarded to `euv` applications.
    ///
    /// # Returns
    ///
    /// - `&'static str` - Render flag token.
    #[must_use]
    pub const fn as_flag(self) -> &'static str {
        match self {
            Self::Auto => RENDER_FLAG_AUTO,
            Self::Software => RENDER_FLAG_SOFTWARE,
            Self::Hardware => RENDER_FLAG_HARDWARE,
            Self::Hybrid => RENDER_FLAG_HYBRID,
        }
    }
}

/// Wire string helpers for `HarmonyFormFactorArg`.
impl HarmonyFormFactorArg {
    /// Returns the canonical lowercase form factor label passed to `build-harmony.sh`.
    ///
    /// # Returns
    ///
    /// - `&'static str` - Lowercase form factor label.
    #[must_use]
    pub const fn as_str(self) -> &'static str {
        match self {
            Self::Phone => HARMONY_FORM_PHONE,
            Self::Tablet => HARMONY_FORM_TABLET,
            Self::Pc => HARMONY_FORM_PC,
            Self::Foldable => HARMONY_FORM_FOLDABLE,
            Self::Tv => HARMONY_FORM_TV,
            Self::Car => HARMONY_FORM_CAR,
            Self::Wearable => HARMONY_FORM_WEARABLE,
        }
    }
}