Rename add_header() to add_text()
add_header() does not necessarily add a header, it might be just text.
This commit is contained in:
parent
a17f7693e9
commit
45d3395642
|
@ -95,7 +95,7 @@ class CliMenu:
|
|||
self._style = self.default_style
|
||||
|
||||
if header:
|
||||
self.add_header(header, indent=False)
|
||||
self.add_text(header, indent=False)
|
||||
|
||||
if options:
|
||||
for option in options:
|
||||
|
@ -104,7 +104,10 @@ class CliMenu:
|
|||
else:
|
||||
self.add_option(option, option)
|
||||
|
||||
def add_header(self, title, indent=True):
|
||||
def add_header(self, *args, **kwargs):
|
||||
return self.add_text(*args, **kwargs)
|
||||
|
||||
def add_text(self, title, indent=True):
|
||||
for text in title.split('\n'):
|
||||
self._items.append(CliMenuHeader(text, indent=indent))
|
||||
|
||||
|
|
Loading…
Reference in New Issue