Skip to main content

#
typed_derive/
main.rs

    1use clap::Parser;
    2
    3mod builtin;
    4mod custom;
    5mod fn_parser;
    6mod foreign_crate;
    7mod implicit;
    8
    9#[derive(Parser, Debug)] // requires `derive` feature
    10#[command(term_width = 0)] // Just to make testing across clap features easier
    11#[command(bin_name = "typed-derive")] // Make testing easier by avoiding `.exe` in Usage on Windows
    12enum Cli {
    13    Implicit(implicit::ImplicitParsers),
    14    Builtin(builtin::BuiltInParsers),
    15    FnParser(fn_parser::FnParser),
    16    Custom(custom::CustomParser),
    17}
    18
    19fn main() {
    20    let cli = Cli::parse();
    21    println!("{cli:?}");
    22}