tag_arg
Shared parser and normalizer for
--tag/tags CLI arguments.CLI tag inputs are split on , by clap’s value_delimiter and each piece is trimmed
by trim_tag. Because clap’s value_parser cannot drop values, callers must then
run the collected list through normalize_tags to discard blank entries produced by
stray or trailing commas (e.g. "a,,b" or "a,b,").
fn trim_tag
pub fn trim_tag(s: &str) -> Result<String, String>Trim whitespace around a single tag value.
Used as a clap value_parser on tag arguments so values survive splitting on , with
surrounding whitespace preserved only inside labels.
| Parameter | Type | Description |
|---|---|---|
s |
&str | one tag value after clap split the argument on , |
| returns | Result<String, String> | The trimmed value, which may be empty; it never fails. |