forked from libre-chip/fayalite
fix doc test
This commit is contained in:
parent
a191ece9a5
commit
422330d195
|
@ -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}"),
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
Loading…
Reference in a new issue