From aabb6539c8b5920b519b40c85093cd5ad07ae229 Mon Sep 17 00:00:00 2001 From: Denis Kolodin Date: Tue, 29 Mar 2022 08:53:06 +0300 Subject: [PATCH] fix: add output option to the status command (#3969) Description --- Fixes an issue with `--non-interactive` mode. The PR adds `--output` option to the `status` command that expected by the non-interactive mode. Motivation and Context --- Non interactive mode failed with: ``` Wrong command to watch `status --output log`. Failed with: error: Found argument '--output' which wasn't expected, or isn't valid in this context If you tried to supply `--output` as a value rather than a flag, use `-- --output` USAGE: status [OUTPUT] For more information try --help ``` How Has This Been Tested? --- Manually --- applications/tari_base_node/src/commands/command/status.rs | 2 +- applications/tari_base_node/src/commands/status_line.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/tari_base_node/src/commands/command/status.rs b/applications/tari_base_node/src/commands/command/status.rs index f4f892aedb..b94c44b9cc 100644 --- a/applications/tari_base_node/src/commands/command/status.rs +++ b/applications/tari_base_node/src/commands/command/status.rs @@ -34,7 +34,7 @@ use crate::commands::status_line::{StatusLine, StatusLineOutput}; /// Prints out the status of this node #[derive(Debug, Parser)] pub struct Args { - #[clap(default_value_t = StatusLineOutput::StdOutAndLog)] + #[clap(short, long, default_value_t = StatusLineOutput::StdOutAndLog)] output: StatusLineOutput, } diff --git a/applications/tari_base_node/src/commands/status_line.rs b/applications/tari_base_node/src/commands/status_line.rs index 1cc025b78d..e2fa549430 100644 --- a/applications/tari_base_node/src/commands/status_line.rs +++ b/applications/tari_base_node/src/commands/status_line.rs @@ -26,9 +26,10 @@ use chrono::Local; use strum::{Display, EnumString}; #[derive(Debug, Display, EnumString)] -#[strum(serialize_all = "lowercase")] pub enum StatusLineOutput { + #[strum(serialize = "log")] Log, + #[strum(serialize = "all")] StdOutAndLog, }