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.
45 lines
1.7 KiB
45 lines
1.7 KiB
use clap::{Arg, App, SubCommand}; |
|
|
|
fn main() { |
|
let generate = SubCommand::with_name("generate") |
|
.about("Generate a new name") |
|
.arg(Arg::with_name("description") |
|
.help("Short description of your application")); |
|
|
|
let adjectives = SubCommand::with_name("adjectives") |
|
.about("Adjectives maintenance") |
|
.subcommand(SubCommand::with_name("list") |
|
.about("List current adjectives")) |
|
.subcommand(SubCommand::with_name("add") |
|
.about("Add a new adjective") |
|
.arg(Arg::with_name("adjective") |
|
.help("Adjective to be added"))) |
|
.subcommand(SubCommand::with_name("rm") |
|
.about("Remove an adjective") |
|
.arg(Arg::with_name("adjective") |
|
.help("Adjective to be removed"))); |
|
|
|
let metals = SubCommand::with_name("metals") |
|
.about("Metal names maintenance") |
|
.subcommand(SubCommand::with_name("list") |
|
.about("List current metal names")) |
|
.subcommand(SubCommand::with_name("add") |
|
.about("Add a new metal name") |
|
.arg(Arg::with_name("adjective") |
|
.help("Metal name to be added"))) |
|
.subcommand(SubCommand::with_name("rm") |
|
.about("Remove a metal name") |
|
.arg(Arg::with_name("adjective") |
|
.help("Metal name to be removed"))); |
|
|
|
let main = App::new("Name Rust Programs") |
|
.version("0.1") |
|
.author("Julio Biason <julio.biason@pm.me>") |
|
.about("From a short description, create a name for your application") |
|
.subcommand(generate) |
|
.subcommand(adjectives) |
|
.subcommand(metals); |
|
|
|
let matches = main.get_matches(); |
|
dbg!(matches); |
|
}
|
|
|