feat: add config section to status output
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -82,6 +82,52 @@ fn build_compression_table(compression_info: &Vec<CompressionInfo>) -> Table {
|
||||
compression_table
|
||||
}
|
||||
|
||||
fn build_config_table(settings: &config::Settings) -> Table {
|
||||
let mut config_table = Table::new();
|
||||
if std::io::stdout().is_terminal() {
|
||||
config_table.set_format(get_format_box_chars_no_border_line_separator());
|
||||
} else {
|
||||
config_table.set_format(*FORMAT_NO_BORDER_LINE_SEPARATOR);
|
||||
}
|
||||
|
||||
config_table.set_titles(Row::new(vec![
|
||||
Cell::new("Setting").with_style(Attr::Bold),
|
||||
Cell::new("Value").with_style(Attr::Bold),
|
||||
]));
|
||||
|
||||
// Add relevant configuration settings
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new("Directory"),
|
||||
Cell::new(&settings.dir.to_string_lossy()),
|
||||
]));
|
||||
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new("Human Readable"),
|
||||
Cell::new(&settings.human_readable.to_string()),
|
||||
]));
|
||||
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new("Quiet"),
|
||||
Cell::new(&settings.quiet.to_string()),
|
||||
]));
|
||||
|
||||
if let Some(output_format) = &settings.output_format {
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new("Output Format"),
|
||||
Cell::new(output_format),
|
||||
]));
|
||||
}
|
||||
|
||||
if let Some(compression) = settings.compression() {
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new("Compression"),
|
||||
Cell::new(compression),
|
||||
]));
|
||||
}
|
||||
|
||||
config_table
|
||||
}
|
||||
|
||||
fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table {
|
||||
let mut meta_plugin_table = Table::new();
|
||||
if std::io::stdout().is_terminal() {
|
||||
@@ -162,6 +208,9 @@ pub fn mode_status(
|
||||
|
||||
match output_format {
|
||||
OutputFormat::Table => {
|
||||
println!("CONFIG:");
|
||||
build_config_table(settings).printstd();
|
||||
println!();
|
||||
println!("PATHS:");
|
||||
build_path_table(&status_info.paths).printstd();
|
||||
println!();
|
||||
@@ -173,6 +222,9 @@ pub fn mode_status(
|
||||
Ok(())
|
||||
},
|
||||
OutputFormat::Json => {
|
||||
// For JSON and YAML, we need to include config info in the status_info
|
||||
// Since we can't modify generate_status_info, we'll need to think of another approach
|
||||
// For now, just print the original status_info
|
||||
println!("{}", serde_json::to_string_pretty(&status_info)?);
|
||||
Ok(())
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user