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, and base URL 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}
31
32/// Shared local HTTP dev server bind, watcher poll interval, and smoke-run arguments.
33#[derive(Args, Clone, Debug, Eq, Getter, PartialEq)]
34pub struct ServerBindArgs {
35    /// Host bind interface.
36    #[arg(long, default_value = DEFAULT_DEV_HOST)]
37    pub(crate) host: String,
38    /// HTTP dev and SSE HMR server port (`0` selects an ephemeral port).
39    #[arg(long, default_value_t = 8080)]
40    #[get(type(copy))]
41    pub(crate) port: u16,
42    /// File watcher polling interval in milliseconds.
43    #[arg(long, default_value_t = 250)]
44    #[get(type(copy))]
45    pub(crate) poll_ms: u64,
46    /// Run initial build and server readiness check then exit immediately.
47    #[arg(long, default_value_t = false)]
48    #[get(type(copy))]
49    pub(crate) once: bool,
50}