const MATCH_ARG_SEVERAL_HELPER: &str = "# Internal helper: strict `match.arg(several.ok = TRUE)` for `several_ok` params.\n# Base R keeps only the elements that match as long as one of them does, so a\n# misspelled entry silently shortens the selection and the per-element check on\n# the Rust side never sees it. Here every element has to match a choice\n# (exactly or as a unique prefix), the first that does not is reported with its\n# position, and `NULL` selects every choice, like an omitted argument does. A\n# factor is read as its labels. `aliases`, a named character vector\n# (`c(grey = \"gray\")`), maps each element typed exactly as an alias to its\n# choice first; a prefix of an alias is not one. `listed` is the text the\n# message names the listed aliases with after the choices\n# (` (or \"grey\" for \"gray\")`, empty when none is listed). The error is an\n# argument error (`.miniextendr_arg_error`) attributed to `call`: by default\n# the wrapper\'s own call, not this helper; a `call = caller` wrapper passes\n# its caller\'s matched call.\n.miniextendr_match_arg_several <- function(arg, choices, arg_name, call = sys.call(-1L), aliases = NULL, listed = \"\") {\n if (is.null(arg)) return(choices)\n if (is.factor(arg)) arg <- as.character(arg)\n if (!is.character(arg)) .miniextendr_arg_error(arg_name, \"must be NULL or a character vector\", call)\n if (length(arg) == 0L) .miniextendr_arg_error(arg_name, \"must be of length >= 1\", call)\n if (!is.null(aliases)) {\n a <- match(arg, names(aliases))\n arg[!is.na(a)] <- aliases[a[!is.na(a)]]\n }\n i <- pmatch(arg, choices, nomatch = 0L, duplicates.ok = TRUE)\n bad <- which(is.na(i) | i == 0L)\n if (length(bad)) {\n .miniextendr_arg_error(arg_name, sprintf(\"element %d (\\\"%s\\\") should be one of %s%s\", bad[[1L]], arg[[bad[[1L]]]], paste(dQuote(choices, FALSE), collapse = \", \"), listed), call)\n }\n choices[i]\n}\n";