macro_rules! arg {
(-$short_arg:tt: $desc:expr) => { ... };
(--$long_arg:tt: $desc:expr) => { ... };
(-$short_arg:tt, --$long_arg:tt: $desc:expr) => { ... };
(-$short_arg:tt <$val:tt>: $desc:expr) => { ... };
(--$long_arg:tt <$val:tt>: $desc:expr) => { ... };
(-$short_arg:tt, --$long_arg:tt <$val:tt>: $desc:expr) => { ... };
(-$short_arg:tt [$( $opt_val:tt )|*]: $desc:expr) => { ... };
(--$long_arg:tt [$( $opt_val:tt )|*]: $desc:expr) => { ... };
(-$short_arg:tt, --$long_arg:tt [$( $opt_val:tt )|*]: $desc:expr) => { ... };
}Expand description
Output documentation for your arguments. Write argument name followed by a
description. This macro replaces underscores in long-name argument token with
hyphens (e.g.: flag!(--my_arg).
-> "--my-arg")
use ezcli::arg;
// Flag (boolean) arguments
arg!(-a, --my_arg: "Description");
// Option arguments
arg!(-a, --my_arg <VALUE>: "Description");
// Option arguments with specific possible values
arg!(-a, --my_arg [V|VAL|VALUE]: "Description");