cli: also accept "~" to be consistent with the new Set action

This commit is contained in:
Vinícius 2022-01-14 08:20:43 -03:00 committed by Peter F. Patel-Schneider
parent a09af769d0
commit 08eb8a06e3
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ def _print_setting(s, verbose=True):
if s.description: if s.description:
print('#', s.description.replace('\n', ' ')) print('#', s.description.replace('\n', ' '))
if s.kind == _settings.KIND.toggle: if s.kind == _settings.KIND.toggle:
print('# possible values: on/true/t/yes/y/1 or off/false/f/no/n/0 or Toggle') print('# possible values: on/true/t/yes/y/1 or off/false/f/no/n/0 or Toggle/~')
elif s.kind == _settings.KIND.choice: elif s.kind == _settings.KIND.choice:
print( print(
'# possible values: one of [', ', '.join(str(v) for v in s.choices), '# possible values: one of [', ', '.join(str(v) for v in s.choices),
@ -82,7 +82,7 @@ def select_choice(value, choices, setting, key):
def select_toggle(value, setting): def select_toggle(value, setting):
if value == 'Toggle': if value.lower() in ('toggle', '~'):
value = not setting.read() value = not setting.read()
else: else:
try: try: