pub fn handle_clap_result<I, T>(cmd: Command, itr: I) -> UResult<ArgMatches>Expand description
Handles clap command parsing results with proper localization support.
This is the main entry point for processing command-line arguments with localized error messages. It parses the provided arguments and returns either the parsed matches or handles errors with localized messages.
§Arguments
cmd- The clapCommandto parse arguments againstitr- An iterator of command-line arguments to parse
§Returns
Ok(ArgMatches)- Successfully parsed command-line argumentsErr- For help/version display (preserves original styling)
§Examples
use clap::Command;
use uucore::clap_localization::handle_clap_result;
let cmd = Command::new("myutil");
let args = vec!["myutil", "--help"];
let result = handle_clap_result(cmd, args);