]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc: new CephString attribute 'allowempty'
authorMilind Changire <mchangir@redhat.com>
Tue, 21 Feb 2023 09:07:19 +0000 (14:37 +0530)
committerMilind Changire <mchangir@redhat.com>
Wed, 16 Apr 2025 09:21:38 +0000 (14:51 +0530)
Signed-off-by: Milind Changire <mchangir@redhat.com>
doc/_ext/ceph_commands.py

index d96eab08853f42ada63cfcd909bf8c4783eb80d9..682abe327e464bcf8c7331036a0310923b3202e2 100644 (file)
@@ -83,7 +83,7 @@ class CmdParam(object):
 
     def __init__(self, type, name,
                  who=None, n=None, req=True, range=None, strings=None,
-                 goodchars=None, positional=True):
+                 goodchars=None, positional=True, **kwargs):
         self.type = type
         self.name = name
         self.who = who
@@ -93,6 +93,7 @@ class CmdParam(object):
         self.strings = strings.split('|') if strings else []
         self.goodchars = goodchars
         self.positional = positional != 'false'
+        self.allowempty = kwargs.pop('allowempty', True) in (True, 'True', 'true')
 
         assert who is None
 
@@ -108,6 +109,8 @@ class CmdParam(object):
             advanced.append('goodchars= ``{}`` '.format(self.goodchars))
         if self.n:
             advanced.append('(can be repeated)')
+        if self.allowempty:
+            advanced.append('(can be empty string)')
 
         advanced = advanced or ["(string)"]
         return ' '.join(advanced)