-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zk_toolbox): Add observability interactive option (#2592)
## What ❔ Add observability interactive option
- Loading branch information
1 parent
0fe173b
commit 3aeaaed
Showing
5 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 19 additions & 2 deletions
21
zk_toolbox/crates/zk_inception/src/commands/args/containers.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
use clap::Parser; | ||
|
||
use crate::messages::MSG_OBSERVABILITY_HELP; | ||
use crate::messages::{MSG_OBSERVABILITY_HELP, MSG_OBSERVABILITY_RUN_PROMPT}; | ||
|
||
#[derive(Debug, Parser)] | ||
pub struct ContainersArgs { | ||
#[clap(long, short = 'o', help = MSG_OBSERVABILITY_HELP)] | ||
#[clap(long, short = 'o', help = MSG_OBSERVABILITY_HELP, default_missing_value = "true", num_args = 0..=1)] | ||
pub observability: Option<bool>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct ContainersArgsFinal { | ||
pub observability: bool, | ||
} | ||
|
||
impl ContainersArgs { | ||
pub fn fill_values_with_prompt(self) -> ContainersArgsFinal { | ||
let observability = self.observability.unwrap_or_else(|| { | ||
common::PromptConfirm::new(MSG_OBSERVABILITY_RUN_PROMPT) | ||
.default(true) | ||
.ask() | ||
}); | ||
|
||
ContainersArgsFinal { observability } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters