use accounts_cli::{Commands, Error};
use clap::Parser;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct Cli {
#[arg(short, long)]
accounts: Option<String>,
#[command(subcommand)]
command: Commands,
}
impl Cli {
fn execute(self) -> Result<(), Error> {
let accounts_path = self.accounts.unwrap_or(".".to_string());
let accounts_path = &accounts_path;
self.command.run(accounts_path)
}
}
fn main() -> Result<(), Error> {
let cli = Cli::parse();
cli.execute()
}