dmc/cli/mod.rs
1use clap::{Parser, Subcommand};
2
3use crate::cli::{build::BuildCmd, compile::CompileCmd, dev::DevCmd, init::InitCmd};
4
5pub mod build;
6pub mod compile;
7pub mod dev;
8pub mod init;
9
10#[derive(Parser)]
11#[command(name = "dmc `dmc`", version, about = "Rust MDX compiler")]
12pub struct Cli {
13 #[command(subcommand)]
14 pub cmd: Cmd,
15}
16
17#[derive(Subcommand)]
18pub enum Cmd {
19 /// Build all collections from dmc.toml.
20 Build(BuildCmd),
21 /// Scaffold a default dmc.toml in the current directory.
22 Init(InitCmd),
23 /// Compile a single MDX file and print JSON to stdout.
24 Compile(CompileCmd),
25 /// Watch the content roots and rebuild on change.
26 Dev(DevCmd),
27}