Allow specifying include/exclude/filter options multiple times by appending

This commit is contained in:
Adam Goldsmith 2023-03-11 01:16:34 -05:00
parent a0ad62c4f2
commit 97d07142d8

View File

@ -318,6 +318,7 @@ def main():
type=AttributeFilter.from_str, type=AttributeFilter.from_str,
default=[], default=[],
nargs="*", nargs="*",
action="extend",
help="filter by 'attribute=value' (may be specified multiple times). Use != to negate the match", help="filter by 'attribute=value' (may be specified multiple times). Use != to negate the match",
) )
common_args.add_argument( common_args.add_argument(
@ -325,6 +326,7 @@ def main():
"--include", "--include",
default=[], default=[],
nargs="*", nargs="*",
action="extend",
help="explicitly include entities by id. Other entities will not be considered if this is specified. Listed entities must also match the specified device class", help="explicitly include entities by id. Other entities will not be considered if this is specified. Listed entities must also match the specified device class",
) )
common_args.add_argument( common_args.add_argument(
@ -332,6 +334,7 @@ def main():
"--exclude", "--exclude",
default=[], default=[],
nargs="*", nargs="*",
action="extend",
help="exclude entities by id", help="exclude entities by id",
) )
common_args.add_argument( common_args.add_argument(