Skip to content

Commit

Permalink
fix: add output option to the status command (#3969)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
therustmonk committed Mar 29, 2022
1 parent c3f6b11 commit aabb653
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion applications/tari_base_node/src/commands/command/status.rs
Expand Up @@ -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,
}

Expand Down
3 changes: 2 additions & 1 deletion applications/tari_base_node/src/commands/status_line.rs
Expand Up @@ -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,
}

Expand Down

0 comments on commit aabb653

Please sign in to comment.