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};
/// # #[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}"),
/// }
/// }
/// ```