Skip to content

Commit

Permalink
[cli] log-level -> log_level, fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Chojan Shang <[email protected]>
  • Loading branch information
PsiACE committed Dec 9, 2021
1 parent 7d21c4e commit d6ce0a5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cli/src/cmds/clusters/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl Command for AddCommand {
)
.arg(
Arg::new("log_level")
.long("log-level")
.long("log_level")
.help("Set logging level")
.takes_value(true)
.env(databend_query::configs::config_log::LOG_LEVEL)
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cmds/clusters/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ impl Command for CreateCommand {
)
.arg(
Arg::new("log_level")
.long("log-level")
.long("log_level")
.help("Set logging level")
.takes_value(true)
.env(databend_query::configs::config_log::LOG_LEVEL)
Expand Down
4 changes: 2 additions & 2 deletions cli/src/cmds/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Processor {

pub async fn process_run(&mut self) -> Result<()> {
let mut writer = Writer::create();
if let Some(level) = self.env.conf.clap.value_of("log-level") {
if let Some(level) = self.env.conf.clap.value_of("log_level") {
if level != "info" {
writer.debug = true;
}
Expand All @@ -97,7 +97,7 @@ impl Processor {

loop {
let mut writer = Writer::create();
if let Some(level) = self.env.conf.clap.value_of("log-level") {
if let Some(level) = self.env.conf.clap.value_of("log_level") {
if level != "info" {
writer.debug = true;
}
Expand Down
4 changes: 2 additions & 2 deletions cli/src/cmds/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ impl Command for RootCommand {
)
.arg(
Arg::new("log_level")
.long("log-level")
.help("Sets the log-level for current settings")
.long("log_level")
.help("Sets the log_level for current settings")
.env("BEND_LOG_LEVEL")
.default_value("info")
.global(true)
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/it/clusters/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn test_generate_local_meta_config() -> Result<()> {
"local",
"--meta-address",
"0.0.0.0:7777",
"--log-level",
"--log_level",
"DEBUG",
"--version",
"v0.4.111-nightly",
Expand Down Expand Up @@ -215,7 +215,7 @@ fn test_generate_local_query_config() -> Result<()> {
"local",
"--meta-address",
"0.0.0.0:7777",
"--log-level",
"--log_level",
"DEBUG",
"--version",
"v0.4.111-nightly",
Expand Down

0 comments on commit d6ce0a5

Please sign in to comment.