fix doc test
All checks were successful
/ test (push) Successful in 15m15s

This commit is contained in:
Jacob Lifshay 2024-07-21 21:09:31 -07:00
parent a191ece9a5
commit 422330d195
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c

View file

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