Corrective error for a flag with no following value, stating the exact fix (booleans get the `true`/`false` example verbatim).
(flag: &str, prop_schema: Option<&Value>)
| 497 | /// Corrective error for a flag with no following value, stating the exact fix |
| 498 | /// (booleans get the `true`/`false` example verbatim). |
| 499 | fn missing_flag_value_error(flag: &str, prop_schema: Option<&Value>) -> TraceDecayError { |
| 500 | let is_boolean = prop_schema |
| 501 | .and_then(|p| p.get("type")) |
| 502 | .and_then(Value::as_str) |
| 503 | == Some("boolean"); |
| 504 | let message = if is_boolean { |
| 505 | format!("flag `{flag}` requires a value — pass `{flag} true` or `{flag} false`") |
| 506 | } else { |
| 507 | format!("flag `{flag}` requires a value — write `{flag} <value>` or `{flag}=<value>`") |
| 508 | }; |
| 509 | TraceDecayError::Config { message } |
| 510 | } |
| 511 | |
| 512 | fn bind_positionals( |
| 513 | def: &ToolDefinition, |
no outgoing calls
no test coverage detected