cli (list/set): add "--comments" argument.

This commit is contained in:
Goffi 2024-06-20 14:46:55 +02:00
commit 0c785f0934

View file

@ -100,6 +100,13 @@ class Set(base.CommandBase):
default="auto",
help=_("update existing item instead of replacing it (DEFAULT: auto)"),
)
self.parser.add_argument(
"-C",
"--comments",
choices=("auto", "true", "false"),
default="auto",
help=_("create comments node (DEFAULT: auto)"),
)
self.parser.add_argument(
"item",
nargs="?",
@ -121,6 +128,8 @@ class Set(base.CommandBase):
values.setdefault(field_data[0], []).extend(field_data[1:])
extra = {"update": update}
if self.args.comments != "auto":
extra["comments"] = bool(self.args.comments)
try:
item_id = await self.host.bridge.list_set(