pub(crate) fn proc_cmd(
cmd: &str,
text: &[String],
file_string: Option<&str>,
opts: &Options,
stats: &mut Stats,
) -> boolExpand description
Substitute placeholders in a command template and execute the result.
§Modes
- Default mode (one invocation per match):
%0= basename,%1= full path,%2+= extra args,%b= stem,%e= extension. --list-allmode (-l): all matching file paths are collected first byfill_list(), joined into a single space-delimited string, and passed asfile_string. In this mode%0is replaced with the entire list of matched paths rather than an individual filename.
Supports confirm mode, dry-run, parallel forking, and stop-on-error.
§Arguments
cmd— the command template string containing%placeholderstext— slice of strings:text[0]is the matched file path (unused in list-all mode),text[1+]are extra CLI argumentsfile_string— when--list-allis active, the space-joined list of all matched paths;Nonein default per-file modeopts— runtime optionsstats— mutable execution statistics
§Returns
true to continue processing, false to stop (stop-on-error triggered).