cli: use 1-origin addressing when selecting from choices in config

This commit is contained in:
Peter F. Patel-Schneider 2021-03-18 09:24:40 -04:00
parent 58f1a142ec
commit dc3f70ff86
1 changed files with 2 additions and 2 deletions

View File

@ -63,8 +63,8 @@ def select_choice(value, choices, setting, key):
break
if val is not None:
value = val
elif ivalue is not None and ivalue >= 0 and ivalue < len(choices):
value = choices[ivalue]
elif ivalue is not None and ivalue >= 1 and ivalue <= len(choices):
value = choices[ivalue - 1]
elif lvalue in ('higher', 'lower'):
old_value = setting.read() if key is None else setting.read_key(key)
if old_value is None: