Print internal state table dump (hidden debug feature)
(os: &Os, format: OutputFormat)
| 98 | |
| 99 | /// Print internal state table dump (hidden debug feature) |
| 100 | fn print_state_dump(os: &Os, format: OutputFormat) -> Result<()> { |
| 101 | let settings = os.database.get_all_entries()?; |
| 102 | match format { |
| 103 | OutputFormat::Plain => { |
| 104 | for (key, value) in settings { |
| 105 | println!("{key} = {value}"); |
| 106 | } |
| 107 | }, |
| 108 | OutputFormat::Json => { |
| 109 | println!("{}", serde_json::to_string(&settings)?); |
| 110 | }, |
| 111 | OutputFormat::JsonPretty => { |
| 112 | println!("{}", serde_json::to_string_pretty(&settings)?); |
| 113 | }, |
| 114 | } |
| 115 | Ok(()) |
| 116 | } |
| 117 | |
| 118 | /// Collect all settings with their metadata and current values |
| 119 | fn collect_settings(os: &Os) -> Vec<SettingInfo> { |
no test coverage detected