pacak / bpaf

Command line parser with applicative interface
Apache License 2.0
340 stars 17 forks source link

support function calls inside `external` in `bpaf_derive` #270

Open pacak opened 1 year ago

pacak commented 1 year ago

Currently external supports explicit or implicit path to a function, support function call directly as well?

with function no_bool to generate --foo and --no-foo this would allow to write something like this

#[derive(Debug, Clone, Bpaf)]
struct Options {
    #[bpaf(external(no_bool("banana", "no banana")), help("Should banana be enabled?")]
    banana: bool
}