Type sytem assisted command line argument parser
entrance
provides type assisted tools for parsing command line arguments.
```rust use entrance::*; use std::env::args;
fn main() {
let command: Command
match command.call_type() {
CallType::Informative(info_opt) => match info_opt {
DefaultInformativeOption::Help => {
println!("{}", command.help());
}
DefaultInformativeOption::Version => {
println!("{} {}", command.name(), env!("CARGO_PKG_VERSION"));
}
},
_ => {}
}
} ```
This struct provides tools for parsing command line arguments.
Before parsing command line arguments, it is necessary to create the instance
with the associated function new
.
Then, use parse
or parse_options
and parse_arguments
.
If arguments should be parsed after checking options, use parse_options
and parse_arguments
.
Otherwise, use parse
simply.
A derive macro is available for this.
Limitation: the macro supports only the struct with bool
members.
A derive macro is available for this.
Limitation: the macro supports only the struct with members implementing FromStr
.