Skip to main content

euv_cli/args/
struct.rs

1use super::*;
2
3/// Root CLI parser for the `euv` cross-platform native toolchain.
4#[derive(Clone, Debug, Eq, Getter, Parser, PartialEq)]
5#[command(
6    name = "euv",
7    version,
8    about = "Cross-platform native Rust UI CLI for euv"
9)]
10pub struct Cli {
11    /// Selected subcommand to execute.
12    #[command(subcommand)]
13    pub(crate) command: Commands,
14}
15
16/// Shared documentation source, output, title, base URL, and WASM site build arguments.
17#[derive(Args, Clone, Debug, Eq, Getter, PartialEq)]
18pub struct DocsBuildArgs {
19    /// Optional source project or Markdown directory (defaults to current working directory).
20    pub(crate) src: Option<PathBuf>,
21    /// Output directory for generated HTML, search index, sitemap, and assets.
22    #[arg(long, default_value = DEFAULT_DOCS_OUT_DIR)]
23    pub(crate) out: PathBuf,
24    /// Optional site brand title overriding frontmatter and folder name.
25    #[arg(long)]
26    pub(crate) title: Option<String>,
27    /// Optional URL base prefix (for example `/docs`).
28    #[arg(long, default_value = "")]
29    pub(crate) base: String,
30    /// Build a zero-JS multi-locale WebAssembly documentation site via `euv-docs`.
31    #[arg(long, default_value_t = false)]
32    #[get(type(copy))]
33    pub(crate) wasm: bool,
34    /// Force static HTML site output even when multi-locale frontmatter is detected.
35    #[arg(long, default_value_t = false)]
36    #[get(type(copy))]
37    pub(crate) static_html: bool,
38    /// Optional single-locale filter (`dir`, `prefix`, `lang`, or `label`) for WASM docs builds.
39    #[arg(long)]
40    pub(crate) locale: Option<String>,
41    /// Compile WASM documentation bundles with the optimized release profile.
42    #[arg(long, default_value_t = false)]
43    #[get(type(copy))]
44    pub(crate) release: bool,
45}
46
47/// Shared local HTTP dev server bind, watcher poll interval, and smoke-run arguments.
48#[derive(Args, Clone, Debug, Eq, Getter, PartialEq)]
49pub struct ServerBindArgs {
50    /// Host bind interface.
51    #[arg(long, default_value = DEFAULT_DEV_HOST)]
52    pub(crate) host: String,
53    /// HTTP dev and SSE HMR server port (`0` selects an ephemeral port).
54    #[arg(long, default_value_t = 8080)]
55    #[get(type(copy))]
56    pub(crate) port: u16,
57    /// File watcher polling interval in milliseconds.
58    #[arg(long, default_value_t = 250)]
59    #[get(type(copy))]
60    pub(crate) poll_ms: u64,
61    /// Run initial build and server readiness check then exit immediately.
62    #[arg(long, default_value_t = false)]
63    #[get(type(copy))]
64    pub(crate) once: bool,
65}