doc:s: add documentation and complete the readme
All checks were successful
build and upload / build (push) Successful in 16s

This commit is contained in:
2025-05-03 01:30:35 +02:00
parent eafee7e164
commit 3bca4ef8bd
9 changed files with 249 additions and 7 deletions

View File

@@ -11,8 +11,11 @@ pub type Result<T> = core::result::Result<T, Box<dyn Error>>;
#[derive(Parser, Debug, PartialEq)]
#[command(name = crate_name!(), author = crate_authors!(), version = crate_version!(), about = crate_description!())]
pub struct Cli {
#[arg(long = "generate", hide = true, value_enum)]
pub generator: Option<Shell>,
#[arg(long, hide = true, value_enum)]
pub completion: Option<Shell>,
#[arg(long, hide = true)]
pub doc: bool,
#[command(subcommand)]
pub command: Option<Commands>,

View File

@@ -8,9 +8,16 @@ fn main() {
configure_logger();
let cli = Cli::parse();
if cli.doc {
log::info!("Generating markdown documentation...");
clap_markdown::print_help_markdown::<Cli>();
return;
}
let mut cmd = Cli::command();
if let Some(generator) = cli.generator {
if let Some(generator) = cli.completion {
log::info!("Generating completion file for {generator:?}...");
print_completions(generator, &mut cmd);
return;