Skip to content

Commit

Permalink
Add markdown reference generator (#39)
Browse files Browse the repository at this point in the history
* add clap_markdown crate

* add hidden command to generate markdown reference

* replace hidden flag arg for help with hidden subcommand
  • Loading branch information
keturiosakys authored Jun 21, 2023
1 parent 15808e7 commit 77fd04d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ categories = ["development-tools::profiling"]
anyhow = { version = "1.0.71" }
axum = { version = "0.6.18" }
clap = { version = "4.2.7", features = ["derive", "env"] }
clap-markdown = "0.1.3"
dialoguer = "0.10.4"
directories = { version = "5.0.1" }
flate2 = { version = "1.0.26" }
Expand Down
7 changes: 7 additions & 0 deletions src/bin/am/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ pub enum SubCommands {

/// Manage am related system settings.
System(system::Arguments),

#[clap(hide = true)]
MarkdownHelp,
}

pub async fn handle_command(app: Application) -> Result<()> {
match app.command {
SubCommands::Start(args) => start::handle_command(args).await,
SubCommands::System(args) => system::handle_command(args).await,
SubCommands::MarkdownHelp => {
clap_markdown::print_help_markdown::<Application>();
Ok(())
}
}
}

0 comments on commit 77fd04d

Please sign in to comment.