mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
feat: add qmc2 cli
This commit is contained in:
@@ -16,8 +16,8 @@ pub struct Cli {
|
||||
command: Option<Commands>,
|
||||
|
||||
/// Be more verbose about what is going on.
|
||||
#[clap(long, short, action=clap::ArgAction::SetTrue)]
|
||||
verbose: Option<bool>,
|
||||
#[clap(long, short, action=clap::ArgAction::SetTrue, default_value_t=false)]
|
||||
verbose: bool,
|
||||
|
||||
/// Preferred buffer size when reading file, in bytes.
|
||||
/// Default to 4MiB.
|
||||
@@ -28,6 +28,7 @@ pub struct Cli {
|
||||
fn run_command(cli: &Cli) -> Result<i32> {
|
||||
match &cli.command {
|
||||
Some(Commands::QMCv1(cmd)) => cmd.run(&cli),
|
||||
Some(Commands::QMCv2(cmd)) => cmd.run(&cli),
|
||||
None => {
|
||||
// https://github.com/clap-rs/clap/issues/3857#issuecomment-1161796261
|
||||
todo!("implement a sensible default command, similar to um/cli");
|
||||
@@ -43,7 +44,7 @@ fn main() {
|
||||
-1
|
||||
});
|
||||
let duration = start.elapsed();
|
||||
if let Some(true) = cli.verbose {
|
||||
if cli.verbose {
|
||||
eprintln!("time: {:?}", duration);
|
||||
};
|
||||
exit(code);
|
||||
|
||||
Reference in New Issue
Block a user