feat: use default options and outputs for meta plugins
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -58,6 +58,13 @@ struct MetaPluginConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn mode_generate_config(_cmd: &mut Command, _settings: &crate::config::Settings) -> Result<()> {
|
pub fn mode_generate_config(_cmd: &mut Command, _settings: &crate::config::Settings) -> Result<()> {
|
||||||
|
// Create instances of each meta plugin to get their default options and outputs
|
||||||
|
let text_plugin = crate::meta_plugin::text::TextMetaPlugin::new(None, None);
|
||||||
|
let cwd_plugin = crate::meta_plugin::cwd::CwdMetaPlugin::new(None, None);
|
||||||
|
let digest_plugin = crate::meta_plugin::digest::DigestMetaPlugin::new(None, None);
|
||||||
|
let hostname_plugin = crate::meta_plugin::hostname::HostnameMetaPlugin::new(None, None);
|
||||||
|
let magic_file_plugin = crate::meta_plugin::magic::MagicFileMetaPlugin::new(None, None);
|
||||||
|
|
||||||
// Create a default configuration
|
// Create a default configuration
|
||||||
let default_config = DefaultConfig {
|
let default_config = DefaultConfig {
|
||||||
dir: Some("~/.local/share/keep".to_string()),
|
dir: Some("~/.local/share/keep".to_string()),
|
||||||
@@ -98,12 +105,6 @@ pub fn mode_generate_config(_cmd: &mut Command, _settings: &crate::config::Setti
|
|||||||
align: ColumnAlignment::Left,
|
align: ColumnAlignment::Left,
|
||||||
max_len: Some("28".to_string()),
|
max_len: Some("28".to_string()),
|
||||||
},
|
},
|
||||||
ColumnConfig {
|
|
||||||
name: "meta:command".to_string(),
|
|
||||||
label: Some("Command".to_string()),
|
|
||||||
align: ColumnAlignment::Left,
|
|
||||||
max_len: Some("100".to_string()),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
human_readable: false,
|
human_readable: false,
|
||||||
output_format: Some("table".to_string()),
|
output_format: Some("table".to_string()),
|
||||||
@@ -120,28 +121,28 @@ pub fn mode_generate_config(_cmd: &mut Command, _settings: &crate::config::Setti
|
|||||||
meta_plugins: Some(vec![
|
meta_plugins: Some(vec![
|
||||||
MetaPluginConfig {
|
MetaPluginConfig {
|
||||||
name: "text".to_string(),
|
name: "text".to_string(),
|
||||||
options: std::collections::HashMap::new(),
|
options: text_plugin.options().clone(),
|
||||||
outputs: std::collections::HashMap::new(),
|
outputs: text_plugin.outputs().clone(),
|
||||||
},
|
},
|
||||||
MetaPluginConfig {
|
MetaPluginConfig {
|
||||||
name: "cwd".to_string(),
|
name: "cwd".to_string(),
|
||||||
options: std::collections::HashMap::new(),
|
options: cwd_plugin.options().clone(),
|
||||||
outputs: std::collections::HashMap::new(),
|
outputs: cwd_plugin.outputs().clone(),
|
||||||
},
|
},
|
||||||
MetaPluginConfig {
|
MetaPluginConfig {
|
||||||
name: "digest".to_string(),
|
name: "digest".to_string(),
|
||||||
options: std::collections::HashMap::new(),
|
options: digest_plugin.options().clone(),
|
||||||
outputs: std::collections::HashMap::new(),
|
outputs: digest_plugin.outputs().clone(),
|
||||||
},
|
},
|
||||||
MetaPluginConfig {
|
MetaPluginConfig {
|
||||||
name: "hostname".to_string(),
|
name: "hostname".to_string(),
|
||||||
options: std::collections::HashMap::new(),
|
options: hostname_plugin.options().clone(),
|
||||||
outputs: std::collections::HashMap::new(),
|
outputs: hostname_plugin.outputs().clone(),
|
||||||
},
|
},
|
||||||
MetaPluginConfig {
|
MetaPluginConfig {
|
||||||
name: "magic_file".to_string(),
|
name: "magic_file".to_string(),
|
||||||
options: std::collections::HashMap::new(),
|
options: magic_file_plugin.options().clone(),
|
||||||
outputs: std::collections::HashMap::new(),
|
outputs: magic_file_plugin.outputs().clone(),
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user