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

Method cli_parameters

crates/chat-cli/src/cli/chat/tools/use_aws.rs:163–175  ·  view source on GitHub ↗

Returns the CLI arguments properly formatted as kebab case if parameters is [Option::Some], otherwise None

(&self)

Source from the content-addressed store, hash-verified

161 /// Returns the CLI arguments properly formatted as kebab case if parameters is
162 /// [Option::Some], otherwise None
163 fn cli_parameters(&self) -> Option<Vec<(String, String)>> {
164 if let Some(parameters) = &self.parameters {
165 let mut params = vec![];
166 for (param_name, val) in parameters {
167 let param_name = format!("--{}", param_name.trim_start_matches("--").to_case(Case::Kebab));
168 let param_val = val.as_str().map(|s| s.to_string()).unwrap_or(val.to_string());
169 params.push((param_name, param_val));
170 }
171 Some(params)
172 } else {
173 None
174 }
175 }
176
177 pub fn eval_perm(&self, _os: &Os, agent: &Agent) -> PermissionEvalResult {
178 #[derive(Debug, Deserialize)]

Callers 2

invokeMethod · 0.80
test_use_aws_deserFunction · 0.80

Calls 3

mapMethod · 0.80
to_stringMethod · 0.80
as_strMethod · 0.45

Tested by 1

test_use_aws_deserFunction · 0.64