changeset 4272:89a0999884ac

cli (list/set): add "--comments" argument.
author Goffi <goffi@goffi.org>
date Thu, 20 Jun 2024 14:46:55 +0200
parents a5d27f69eedb
children 9308b2d15fd2
files libervia/cli/cmd_list.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/cli/cmd_list.py	Thu Jun 20 14:36:09 2024 +0200
+++ b/libervia/cli/cmd_list.py	Thu Jun 20 14:46:55 2024 +0200
@@ -101,6 +101,13 @@
             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="?",
             default="",
@@ -121,6 +128,8 @@
             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(