From 2bf9430268de56581b108e42c2c815e9bd0cef41 Mon Sep 17 00:00:00 2001 From: qima Date: Mon, 27 May 2024 18:10:55 +0800 Subject: [PATCH] chore(cli): showing cli final execution result explicitly --- sn_cli/src/bin/main.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sn_cli/src/bin/main.rs b/sn_cli/src/bin/main.rs index 22748c35c0..347e4d2465 100644 --- a/sn_cli/src/bin/main.rs +++ b/sn_cli/src/bin/main.rs @@ -140,23 +140,27 @@ async fn main() -> Result<()> { // default to verifying storage let should_verify_store = !opt.no_verify; - match opt.cmd { + // PowerShell seems having issue to showing the unwrapped error + // Hence capture the result and print it out explicity. + let cmd_str = format!("{:?}", opt.cmd); + let result = match opt.cmd { SubCmd::Wallet(cmds) => { - wallet_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await? + wallet_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await } SubCmd::WatchOnlyWallet(cmds) => { - wo_wallet_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await? + wo_wallet_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await } SubCmd::Files(cmds) => { - files_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await? + files_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await } SubCmd::Folders(cmds) => { - folders_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await? + folders_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await } SubCmd::Register(cmds) => { - register_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await? + register_cmds(cmds, &client, &client_data_dir_path, should_verify_store).await } }; + println!("Completed with {result:?} of execute {cmd_str:?}"); Ok(()) }