You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1008 B
33 lines
1008 B
use clap::{Arg};
|
|
use clap_nested::{Commander};
|
|
|
|
mod command;
|
|
|
|
fn main() {
|
|
match Commander::new()
|
|
.options(|app| {
|
|
app.name("Walkman Tools")
|
|
.version("1.0")
|
|
.author("Drew Short <warrick@sothr.com>")
|
|
.about("Management tool for walkman mp3 players")
|
|
.arg(
|
|
Arg::with_name("verbose")
|
|
.short("v")
|
|
.long("verbose")
|
|
.global(true)
|
|
.takes_value(true)
|
|
.value_name("VERBOSITY")
|
|
.help("Sets the logging verbosity, defaults to \"INFO\""),
|
|
)
|
|
})
|
|
.args(|_args, matches| matches.value_of("verbose").unwrap_or("INFO"))
|
|
.add_cmd(command::dedupe::get_command())
|
|
.no_cmd(|_args, _matches| {
|
|
println!("No subcommand matched");
|
|
Ok(())
|
|
})
|
|
.run() {
|
|
Ok(result) => std::process::exit(0),
|
|
Err(err) => println!("{}", err)
|
|
}
|
|
}
|