diff --git a/crates/fayalite/src/cli.rs b/crates/fayalite/src/cli.rs index cb0ddf7..eed7832 100644 --- a/crates/fayalite/src/cli.rs +++ b/crates/fayalite/src/cli.rs @@ -39,26 +39,28 @@ enum CliCommand { /// # use fayalite::{hdl_module}; /// # #[hdl_module] /// # fn my_module() {} +/// use clap::{Subcommand, Parser}; /// -/// #[derive(clap::Subcommand)] -/// pub enum Subcommand { +/// #[derive(Subcommand)] +/// pub enum Cmd { /// #[command(flatten)] /// Fayalite(fayalite::cli::Cli), /// MySpecialCommand { -/// #[arg] +/// #[arg(long)] /// foo: bool, /// }, /// } /// -/// #[derive(clap::Parser)] +/// #[derive(Parser)] /// pub struct Cli { /// #[command(subcommand)] -/// subcommand: Subcommand, // or just use fayalite::cli::Cli directly +/// cmd: Cmd, // or just use fayalite::cli::Cli directly /// } +/// /// fn main() { -/// match Cli::parse().subcommand { -/// Subcommand::Fayalite(v) => v.run(my_module()), -/// Subcommand::MySpecialCommand { foo } => println!("special: foo={foo}"), +/// match Cli::parse().cmd { +/// Cmd::Fayalite(v) => v.run(my_module()), +/// Cmd::MySpecialCommand { foo } => println!("special: foo={foo}"), /// } /// } /// ```