pub fn try_recover_missing_args(
err: &Error,
original_args: &[String],
command: &Command,
app_name: &str,
auto_interactive: bool,
) -> Option<RecoveryResult>Expand description
Attempt to interactively recover from a clap MissingRequiredArgument error.
When the CLI is running interactively and clap reports missing required
arguments, this function prompts the user for each missing value (in
declaration order), appends them to the original args, and returns Some
with the augmented arg list so the caller can re-parse.
Returns None if recovery is not possible (non-interactive or not a
missing-arg error). Returns Some(RecoveryResult::Cancelled { .. }) if
the user cancels mid-prompt.
§Arguments
err— the clap error fromtry_get_matches_fromoriginal_args— the args that were passed to clapcommand— the rootclap::Command(for arg introspection)app_name— the CLI binary name (first arg)auto_interactive— whether the CLI opted into TTY auto-detection