Formatting config options that are not added to default
This commit is contained in:
parent
bf8e18441a
commit
20e546b496
@ -194,11 +194,11 @@ class Option:
|
|||||||
return ans
|
return ans
|
||||||
if option_group:
|
if option_group:
|
||||||
sz = max(len(self.name), max(len(o.name) for o in option_group))
|
sz = max(len(self.name), max(len(o.name) for o in option_group))
|
||||||
a(f'{self.name.ljust(sz)} {self.defval_as_string}')
|
a(f'{self.name.ljust(sz)} {self.defval_as_string}'.rstrip())
|
||||||
for o in option_group:
|
for o in option_group:
|
||||||
a(f'{o.name.ljust(sz)} {o.defval_as_string}')
|
a(f'{o.name.ljust(sz)} {o.defval_as_string}'.rstrip())
|
||||||
else:
|
else:
|
||||||
a(f'{self.name} {self.defval_as_string}')
|
a(f'{self.name} {self.defval_as_string}'.rstrip())
|
||||||
if self.long_text:
|
if self.long_text:
|
||||||
a('')
|
a('')
|
||||||
a(render_block(self.long_text))
|
a(render_block(self.long_text))
|
||||||
@ -257,8 +257,10 @@ class MultiOption:
|
|||||||
a = ans.append
|
a = ans.append
|
||||||
for k in self.items:
|
for k in self.items:
|
||||||
if k.documented:
|
if k.documented:
|
||||||
prefix = '' if k.add_to_default else '# '
|
a(f'{self.name} {k.defval_as_str if k.add_to_default else ""}'.rstrip())
|
||||||
a(f'{prefix}{self.name} {k.defval_as_str}')
|
if not k.add_to_default and k.defval_as_str:
|
||||||
|
a('')
|
||||||
|
a(f'#: E.g. {self.name} {k.defval_as_str}'.rstrip())
|
||||||
if self.long_text:
|
if self.long_text:
|
||||||
a('')
|
a('')
|
||||||
a(render_block(self.long_text))
|
a(render_block(self.long_text))
|
||||||
@ -273,7 +275,7 @@ class MultiOption:
|
|||||||
a('')
|
a('')
|
||||||
for k in self.items:
|
for k in self.items:
|
||||||
if k.documented:
|
if k.documented:
|
||||||
a(f' {self.name:s} {k.defval_as_str}')
|
a(f' {self.name:s} {k.defval_as_str}'.rstrip())
|
||||||
a('')
|
a('')
|
||||||
if self.long_text:
|
if self.long_text:
|
||||||
a(expand_opt_references(conf_name, self.long_text))
|
a(expand_opt_references(conf_name, self.long_text))
|
||||||
@ -306,8 +308,9 @@ class Mapping:
|
|||||||
if self.short_text:
|
if self.short_text:
|
||||||
a(render_block(self.short_text.strip())), a('')
|
a(render_block(self.short_text.strip())), a('')
|
||||||
for sc in [self] + action_group:
|
for sc in [self] + action_group:
|
||||||
if sc.documented and sc.add_to_default:
|
if sc.documented:
|
||||||
a(sc.setting_name + ' ' + sc.parseable_text)
|
prefix = '' if sc.add_to_default else '#:: E.g. '
|
||||||
|
a(f'{prefix}{sc.setting_name} {sc.parseable_text}')
|
||||||
if self.long_text:
|
if self.long_text:
|
||||||
a(''), a(render_block(self.long_text.strip(), '#:: '))
|
a(''), a(render_block(self.long_text.strip(), '#:: '))
|
||||||
a('')
|
a('')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user