Module utils

Module utils 

Source
Expand description

§utils.rs - Utility functions for rgrc

This module contains various utility functions used throughout the rgrc application.

Constants§

PSEUDO_NO_COLOR
Pseudo-commands (exact match) that should NOT be colorized for explicit checks (e.g. rgrc ls should not colorize but rgrc ls -l should).
SUPPORTED_COMMANDS
Curated list of commands that ship with colorization rules.

Functions§

command_exists
Simple command existence check without external dependencies Check whether an executable named cmd exists on the user’s PATH.
pseudo_command_excluded
Check whether an exact pseudo_command should be excluded from colorization.
should_use_colorization_for_command_supported
Check if a command has colorization rules available (used for Always strategy) Return true when a command has shipped colorization rules (present in SUPPORTED_COMMANDS). This is a simple membership check used by the Always colorization strategy.