Skip to content

Commit a1fe350

Browse files
authored
fix(agent): colorizes warning message for profile flag deprecation (#2279)
1 parent da6abd8 commit a1fe350

File tree

1 file changed

+14
-4
lines changed
  • crates/chat-cli/src/cli/chat

1 file changed

+14
-4
lines changed

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,27 @@ impl ChatArgs {
207207
}
208208
}
209209

210+
let stdout = std::io::stdout();
211+
let mut stderr = std::io::stderr();
212+
210213
let args: Vec<String> = std::env::args().collect();
211214
if args
212215
.iter()
213216
.any(|arg| arg == "--profile" || arg.starts_with("--profile="))
214217
{
215-
eprintln!("Warning: --profile is deprecated, use --agent instead");
218+
execute!(
219+
stderr,
220+
style::SetForegroundColor(Color::Yellow),
221+
style::Print("WARNING: "),
222+
style::SetForegroundColor(Color::Reset),
223+
style::Print("--profile is deprecated, use "),
224+
style::SetForegroundColor(Color::Green),
225+
style::Print("--agent"),
226+
style::SetForegroundColor(Color::Reset),
227+
style::Print(" instead\n")
228+
)?;
216229
}
217230

218-
let stdout = std::io::stdout();
219-
let mut stderr = std::io::stderr();
220-
221231
let agents = {
222232
let mut default_agent_name = None::<String>;
223233
let agent_name = if let Some(agent) = self.agent.as_deref() {

0 commit comments

Comments
 (0)