Untitled
unknown
plain_text
2 years ago
864 B
7
Indexable
use clap::Parser;
#[derive(Parser)]
pub enum Opts {
Default(DefaultCommand),
Use(UseCommand),
Remove(RemoveCommand),
}
#[derive(Parser)]
pub struct DefaultCommand {
// Insert parameters for the 'default' command here
}
#[derive(Parser)]
pub struct UseCommand {
// Insert parameters for the 'use' command here
}
#[derive(Parser)]
pub struct RemoveCommand {
// Insert parameters for the 'remove' command here
}
pub fn main() {
let opts: Option<Opts> = Opts::parse_from_args().ok();
match opts {
Some(Opts::Default(args)) => {
// handle 'default' command
},
Some(Opts::Use(args)) => {
// handle 'use' command
},
Some(Opts::Remove(args)) => {
// handle 'remove' command
},
None => {
// handle no command case
}
}
}Editor is loading...