bpaf_derive/
lib.rs

1//! # Derive macro for bpaf command line parser
2//!
3//! For documentation refer to `bpaf` library docs: <https://docs.rs/bpaf/latest/bpaf/>
4
5mod attrs;
6mod field;
7mod named_field;
8mod top;
9mod utils;
10
11#[cfg(test)]
12mod field_tests;
13#[cfg(test)]
14mod top_tests;
15
16mod help;
17
18mod custom_path;
19mod td;
20
21use top::Top;
22
23/// Derive macro for bpaf command line parser
24///
25/// For documentation refer to bpaf library: <https://docs.rs/bpaf/latest/bpaf/>
26#[proc_macro_derive(Bpaf, attributes(bpaf))]
27pub fn derive_macro(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
28    quote::ToTokens::to_token_stream(&syn::parse_macro_input!(input as Top)).into()
29}