pub fn verify_handler_args(
command: &Command,
handler_name: &str,
expected: &[ExpectedArg],
) -> Result<(), HandlerMismatchError>Expand description
Verify that a handler’s expected arguments match a clap Command’s definition.
Returns Ok(()) if all expectations are met, or Err(HandlerMismatchError)
with detailed diagnostics if there are mismatches.
§Arguments
command- The clap Command to verify againsthandler_name- The handler function name (for error messages)expected- The arguments the handler expects (from__expected_args())
§Example
ⓘ
let command = Command::new("list")
.arg(Arg::new("verbose").long("verbose").action(ArgAction::SetTrue));
let expected = vec![ExpectedArg::flag("verbose", "verbose")];
verify_handler_args(&command, "list_handler", &expected)?;