20 lines
432 B
Rust
20 lines
432 B
Rust
use arguments::{Arguments, Commands};
|
|
use clap::Parser;
|
|
use commands::{add, print, remove};
|
|
use shared::errors::Error;
|
|
|
|
mod arguments;
|
|
mod commands;
|
|
|
|
fn main() -> Result<(), Error> {
|
|
let args = Arguments::parse();
|
|
|
|
match &args.command {
|
|
Commands::Print { group } => print(&args.path, &group)?,
|
|
Commands::Add { url, name } => add(&args.path, url, name)?,
|
|
Commands::Remove { url } => remove(&args.path, url)?,
|
|
};
|
|
|
|
Ok(())
|
|
}
|