pub fn configure_localized_command(cmd: Command) -> CommandExpand description
Configures a clap Command with proper localization and color settings.
This function sets up a Command with:
- Appropriate color settings based on environment variables (
NO_COLOR,CLICOLOR_FORCE, etc.) - Localized help template with proper formatting
- TTY detection for automatic color enabling/disabling
§Arguments
cmd- The clapCommandto configure
§Returns
The configured Command with localization and color settings applied.
§Environment Variables
The following environment variables affect color output:
NO_COLOR- Disables all color outputCLICOLOR_FORCEorFORCE_COLOR- Forces color output even when not in a TTYTERM- If set to “dumb”, colors are disabled in auto mode
§Examples
use clap::Command;
use uucore::clap_localization::configure_localized_command;
let cmd = Command::new("myutil")
.arg(clap::Arg::new("input").short('i'));
let configured_cmd = configure_localized_command(cmd);