@@ -221,6 +221,16 @@ def _func(obj):
221221 return [_func (v ) for v in values ]
222222
223223
224+ def string_in_to_filter (ctx , param , values ) -> Union [dict , None ]:
225+
226+ def _func (obj ):
227+ field , values = obj
228+ return data_filter .string_in_filter (field_name = field , values = values )
229+
230+ if values :
231+ return [_func (v ) for v in values ]
232+
233+
224234@data .command ()
225235@click .pass_context
226236@translate_exceptions
@@ -231,7 +241,7 @@ def _func(obj):
231241 callback = assets_to_filter ,
232242 help = """Filter to items with one or more of specified assets.
233243 VALUE is a comma-separated list of entries.
234- When multiple entries are specified an implicit 'or' logic is applied.""" )
244+ When multiple entries are specified, an implicit 'or' logic is applied.""" )
235245@click .option ('--date-range' ,
236246 type = click .Tuple ([FieldType (), ComparisonType (),
237247 DateTimeType ()]),
@@ -253,7 +263,7 @@ def _func(obj):
253263 help = """Filter field by numeric in.
254264 FIELD is the name of the field to filter on.
255265 VALUE is a comma-separated list of entries.
256- When multiple entries are specified an implicit 'or' logic is applied.""" )
266+ When multiple entries are specified, an implicit 'or' logic is applied.""" )
257267@click .option ('--range' ,
258268 'nrange' ,
259269 type = click .Tuple ([FieldType (), ComparisonType (), float ]),
@@ -263,10 +273,14 @@ def _func(obj):
263273 FIELD is the name of the field to filter on.
264274 COMP can be lt, lte, gt, or gte.
265275 DATETIME can be an RFC3339 or ISO 8601 string.""" )
266- # @click.option('--string-in',
267- # type=RangeFilter(),
268- # multiple=True,
269- # help=RangeFilter.help)
276+ @click .option ('--string-in' ,
277+ type = click .Tuple ([FieldType (), CommaSeparatedString ()]),
278+ multiple = True ,
279+ callback = string_in_to_filter ,
280+ help = """Filter field by numeric in.
281+ FIELD is the name of the field to filter on.
282+ VALUE is a comma-separated list of entries.
283+ When multiple entries are specified, an implicit 'or' logic is applied.""" )
270284@click .option (
271285 '--update' ,
272286 type = click .Tuple ([FieldType (), GTComparisonType (), DateTimeType ()]),
@@ -287,6 +301,7 @@ def filter(ctx,
287301 geom ,
288302 number_in ,
289303 nrange ,
304+ string_in ,
290305 update ,
291306 permission ,
292307 pretty ):
@@ -305,6 +320,7 @@ def filter(ctx,
305320 geom ,
306321 number_in ,
307322 nrange ,
323+ string_in ,
308324 update ,
309325 permission )
310326
0 commit comments