Skip to content

Commit a641340

Browse files
committed
Dont print warning for the hidden commands
1 parent 35723db commit a641340

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/q_cli/src/cli/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,12 @@ pub struct Cli {
302302

303303
impl Cli {
304304
pub async fn execute(self) -> Result<ExitCode> {
305-
// Show legacy warning if flag is set
305+
// Show legacy warning if flag is set, but not for hidden commands
306306
if self.show_legacy_warning {
307-
eprintln!("\x1b[33m{}\x1b[0m", LEGACY_WARNING);
307+
let is_hidden_command = matches!(self.subcommand, Some(CliRootCommands::Internal(_)));
308+
if !is_hidden_command {
309+
eprintln!("\x1b[33m{}\x1b[0m", LEGACY_WARNING);
310+
}
308311
}
309312

310313
// Initialize our logger and keep around the guard so logging can perform as expected.

0 commit comments

Comments
 (0)