split_commas¶
-
lsst.daf.butler.cli.utils.
split_commas
(context: click.core.Context, param: click.core.Option, values: str | collections.abc.Iterable[str] | None[str, collections.abc.Iterable[str], None]) → tuple¶ Process a tuple of values, where each value may contain comma-separated values, and return a single list of all the passed-in values.
This function can be passed to the ‘callback’ argument of a click.option to allow it to process comma-separated values (e.g. “–my-opt a,b,c”). If the comma is inside
[]
there will be no splitting.Parameters: - context :
click.Context
orNone
The current execution context. Unused, but Click always passes it to callbacks.
- param :
click.core.Option
orNone
The parameter being handled. Unused, but Click always passes it to callbacks.
- values : iterable of
str
orstr
All the values passed for this option. Strings may contain commas, which will be treated as delimiters for separate values unless they are within
[]
.
Returns: - context :