MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / collect_settings

Function collect_settings

crates/chat-cli/src/cli/settings.rs:119–135  ·  view source on GitHub ↗

Collect all settings with their metadata and current values

(os: &Os)

Source from the content-addressed store, hash-verified

117
118/// Collect all settings with their metadata and current values
119fn collect_settings(os: &Os) -> Vec<SettingInfo> {
120 use strum::EnumMessage;
121
122 Setting::iter()
123 .map(|setting| {
124 let key = setting.as_ref().to_string();
125 let description = setting.get_message().unwrap_or("No description").to_string();
126 let current_value = os.database.settings.get(setting).cloned();
127
128 SettingInfo {
129 key,
130 description,
131 current_value,
132 }
133 })
134 .collect()
135}
136
137/// Print settings list in plain text format with colors
138fn print_settings_plain(settings: &[SettingInfo]) {

Callers 1

print_all_settingsFunction · 0.85

Calls 5

mapMethod · 0.80
to_stringMethod · 0.80
as_refMethod · 0.45
get_messageMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected