fix: Improve --status-plugins output for various formats
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -360,11 +360,15 @@ pub fn mode_status(
|
|||||||
build_meta_plugin_table(&status_info.meta_plugins).printstd();
|
build_meta_plugin_table(&status_info.meta_plugins).printstd();
|
||||||
println!();
|
println!();
|
||||||
|
|
||||||
// Print META PLUGINS CONFIGURED if they exist
|
// Always try to print META PLUGINS CONFIGURED section
|
||||||
if let Some(meta_plugins_table) = build_meta_plugins_configured_table(settings) {
|
if let Some(meta_plugins_table) = build_meta_plugins_configured_table(settings) {
|
||||||
println!("META PLUGINS CONFIGURED:");
|
println!("META PLUGINS CONFIGURED:");
|
||||||
meta_plugins_table.printstd();
|
meta_plugins_table.printstd();
|
||||||
println!();
|
println!();
|
||||||
|
} else {
|
||||||
|
println!("META PLUGINS CONFIGURED:");
|
||||||
|
println!("No plugins configured");
|
||||||
|
println!();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("CONFIG:");
|
println!("CONFIG:");
|
||||||
@@ -386,7 +390,7 @@ pub fn mode_status(
|
|||||||
// Create a subset for plugins only
|
// Create a subset for plugins only
|
||||||
let plugins_info = serde_json::json!({
|
let plugins_info = serde_json::json!({
|
||||||
"meta_plugins_available": status_info.meta_plugins,
|
"meta_plugins_available": status_info.meta_plugins,
|
||||||
"meta_plugins_configured": settings.meta_plugins.as_ref().map(|plugins| plugins)
|
"meta_plugins_configured": settings.meta_plugins
|
||||||
});
|
});
|
||||||
println!("{}", serde_json::to_string_pretty(&plugins_info)?);
|
println!("{}", serde_json::to_string_pretty(&plugins_info)?);
|
||||||
} else {
|
} else {
|
||||||
@@ -396,14 +400,25 @@ pub fn mode_status(
|
|||||||
},
|
},
|
||||||
OutputFormat::Yaml => {
|
OutputFormat::Yaml => {
|
||||||
if plugins_only {
|
if plugins_only {
|
||||||
// Create a subset for plugins only
|
// Create a proper structure for plugins info
|
||||||
let plugins_info = serde_yaml::to_string(&serde_yaml::Value::Mapping(serde_yaml::Mapping::new()))?;
|
use serde_yaml::Mapping;
|
||||||
// This needs to be more precise, but for now, just print the original
|
let mut plugins_mapping = Mapping::new();
|
||||||
println!("{}", serde_yaml::to_string(&status_info.meta_plugins)?);
|
|
||||||
|
// Add available plugins
|
||||||
|
plugins_mapping.insert(
|
||||||
|
serde_yaml::Value::String("meta_plugins_available".to_string()),
|
||||||
|
serde_yaml::to_value(&status_info.meta_plugins)?,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add configured plugins if they exist
|
||||||
if let Some(configured_plugins) = &settings.meta_plugins {
|
if let Some(configured_plugins) = &settings.meta_plugins {
|
||||||
println!("---");
|
plugins_mapping.insert(
|
||||||
println!("{}", serde_yaml::to_string(&configured_plugins)?);
|
serde_yaml::Value::String("meta_plugins_configured".to_string()),
|
||||||
|
serde_yaml::to_value(configured_plugins)?,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!("{}", serde_yaml::to_string(&plugins_mapping)?);
|
||||||
} else {
|
} else {
|
||||||
println!("{}", serde_yaml::to_string(&status_info)?);
|
println!("{}", serde_yaml::to_string(&status_info)?);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user