Header indentation and tuple options for constructor
This commit is contained in:
parent
2f2049bfef
commit
6a128e13a6
|
@ -91,11 +91,14 @@ class CliMenu:
|
||||||
self._style = self.default_stye
|
self._style = self.default_stye
|
||||||
|
|
||||||
if header:
|
if header:
|
||||||
self.add_header(header)
|
self.add_header(header, indent=False)
|
||||||
|
|
||||||
if options:
|
if options:
|
||||||
for option in options:
|
for option in options:
|
||||||
self.add_option(option)
|
if isinstance(option, tuple):
|
||||||
|
self.add_option(*option)
|
||||||
|
else:
|
||||||
|
self.add_option(option)
|
||||||
|
|
||||||
def add_header(self, title, indent=True):
|
def add_header(self, title, indent=True):
|
||||||
for text in title.split('\n'):
|
for text in title.split('\n'):
|
||||||
|
|
Loading…
Reference in New Issue