doc:s: add documentation and complete the readme
All checks were successful
build and upload / build (push) Successful in 16s
All checks were successful
build and upload / build (push) Successful in 16s
This commit is contained in:
@@ -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>,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user