pub fn convert_extra_arg_val(args: &[String]) -> Vec<String>Expand description
Converts the parsed value of the --extra-arg option into an optional vector of strings.
This is for adapting to 2 scenarios where --extra-arg is either
- specified multiple times
- each val is appended to a
Vec(by clap crate)
- each val is appended to a
- specified once with multiple space-separated values
- resulting
Vecis made from splitting at the spaces between
- resulting
- not specified at all (returns empty
Vec)
It is preferred that the values specified in either situation do not contain spaces and are quoted:
--extra-arg="-std=c++17" --extra-arg="-Wall"
# or equivalently
--extra-arg="-std=c++17 -Wall"The cpp-linter-action (for Github CI workflows) can only use 1 extra-arg input option, so
the value will be split at spaces.