diff --git a/trustchain-cli/src/bin/main.rs b/trustchain-cli/src/bin/main.rs index 0f334cf7..56ee72e1 100644 --- a/trustchain-cli/src/bin/main.rs +++ b/trustchain-cli/src/bin/main.rs @@ -53,8 +53,8 @@ fn cli() -> Command { .subcommand( Command::new("verify") .about("Verifies a DID.") - .arg(arg!(-v - -verbose).action(ArgAction::SetTrue)) - .arg(arg!(-d --did ).required(true)), + .arg(arg!(-d --did ).required(true)) + .arg(arg!(-t --root_event_time ).required(false)) ), ) .subcommand( @@ -141,6 +141,15 @@ async fn main() -> Result<(), Box> { to_string_pretty(&res_meta).expect("Cannot convert to JSON.") ); } + Some(("verify", sub_matches)) => { + let did = sub_matches.get_one::("did").unwrap(); + let root_event_time = match sub_matches.get_one::("root_event_time") { + Some(time) => time.parse::().unwrap(), + None => cli_config().root_event_time, + }; + let did_chain = TrustchainAPI::verify(did, root_event_time, &verifier).await?; + println!("{did_chain}"); + } _ => panic!("Unrecognised DID subcommand."), } }