1use clap::Parser;
2
3use crate::*;
4
5pub fn run() -> anyhow::Result<()> {
6 let mut args = CliArgs::parse();
7 args.merge_config(Config::retrieve(args.config_path())?);
8
9 match args.cmd {
10 CliSubcommand::Encrypt(encrypt_args) => Cli::encrypt(encrypt_args),
11 CliSubcommand::Decrypt(decrypt_args) => Cli::decrypt(decrypt_args),
12 CliSubcommand::Edit(input_args) => Cli::edit(input_args),
13 CliSubcommand::Keys(key_command) => Cli::keys(key_command),
14 CliSubcommand::Refresh(refresh_args) => Cli::refresh(refresh_args),
15 }
16}