Skip to content

Commit 498819c

Browse files
committed
refactor(client-cli): rework snapshot-converter prints
So it conforms ADR#7 - Standardize log output: - print every progress message in stderr - add support for json output Note: as the command run a subcommand, the subcommands print are only shown when json output is disabled, if we want otherwise we need to intercept messages to format them in a json object (which is not trivial).
1 parent 03f5d3c commit 498819c

File tree

3 files changed

+205
-67
lines changed

3 files changed

+205
-67
lines changed

mithril-client-cli/src/commands/tools/utxo_hd/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ pub enum UTxOHDCommands {
2020

2121
impl UTxOHDCommands {
2222
/// Execute UTxO-HD command
23-
pub async fn execute(&self, _context: CommandContext) -> MithrilResult<()> {
23+
pub async fn execute(&self, context: CommandContext) -> MithrilResult<()> {
2424
match self {
2525
Self::SnapshotConverter(cmd) => {
2626
if cfg!(target_os = "linux") && cfg!(target_arch = "aarch64") {
2727
return Err(anyhow!(
2828
"'snapshot-converter' command is not supported on Linux ARM"
2929
));
3030
}
31-
cmd.execute().await
31+
cmd.execute(context).await
3232
}
3333
}
3434
}

0 commit comments

Comments
 (0)