Go to file
sierra cc4aff51b3 Add LICENSE 2024-02-28 22:44:30 +00:00
src refactor: fix type of main gen 2024-02-14 12:43:50 -06:00
.envrc fix: update flake and refactor 2024-02-14 11:44:00 -06:00
.gitignore fix: update flake and refactor 2024-02-14 11:44:00 -06:00
Cargo.lock docs: fix readme 2024-02-15 16:49:09 -06:00
Cargo.toml docs: fix readme 2024-02-15 16:49:09 -06:00
LICENSE Add LICENSE 2024-02-28 22:44:30 +00:00
README.md docs: fix readme 2024-02-15 16:49:09 -06:00
flake.lock fix: update flake and refactor 2024-02-14 11:44:00 -06:00
flake.nix fix: update flake and refactor 2024-02-14 11:44:00 -06:00

README.md

Clap Main

This crate provides an procmacro #[clap_main] to decorate your entry point function and automatically parse a struct that implements clap::Parser from the cli args.

Example Usage

Requires clap with the derive feature enabled


#[derive(clap::Parser)]
struct CliArgs {
  /// A name to be greeted
  name: String
}

#[clap_main::clap_main]
fn main(CliArgs { name }: CliArgs) {
  println!("Hello {name}");  
}