From 7311988d4aaa6f3f63c8a29f83657b68a63f4749 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Fri, 29 Aug 2025 15:39:06 -0300 Subject: [PATCH] feat: comment out all lines in generated config Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/modes/generate_config.rs | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/modes/generate_config.rs b/src/modes/generate_config.rs index b62774a..2c2e25e 100644 --- a/src/modes/generate_config.rs +++ b/src/modes/generate_config.rs @@ -154,33 +154,17 @@ pub fn mode_generate_config(_cmd: &mut Command, _settings: &crate::config::Setti ]), }; - // Serialize to YAML and add comments + // Serialize to YAML and comment out all lines let yaml = serde_yaml::to_string(&default_config)?; - // Add comments before each top-level section + // Comment out every line let commented_yaml = yaml .lines() .map(|line| { - if line == "dir: ~/.local/share/keep" { - "# Directory where items are stored\n".to_string() + line - } else if line == "list_format:" { - "\n# Table columns configuration for 'list' command\n".to_string() + line - } else if line == "human_readable: false" { - "\n# Display sizes in human-readable format\n".to_string() + line - } else if line == "output_format: table" { - "\n# Output format: table, json, or yaml\n".to_string() + line - } else if line == "quiet: false" { - "\n# Suppress non-essential output\n".to_string() + line - } else if line == "force: false" { - "\n# Overwrite existing items without confirmation\n".to_string() + line - } else if line == "server:" { - "\n# Server configuration for remote access\n".to_string() + line - } else if line == "compression_plugin: null" { - "\n# Compression plugin configuration\n".to_string() + line - } else if line == "meta_plugins:" { - "\n# Meta plugins configuration\n".to_string() + line - } else { + if line.trim().is_empty() { line.to_string() + } else { + format!("# {}", line) } }) .collect::>()