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::>()