This commit is contained in:
Anthony Scopatz 2018-07-14 10:53:45 -05:00
parent 73beffb87a
commit 167052c0b1
2 changed files with 5 additions and 1 deletions

View file

@ -167,7 +167,7 @@ def parser():
'Possible options: readline, prompt_toolkit, random. '
'Warning! If set this overrides $SHELL_TYPE variable.',
dest='shell_type',
choices=('readline', 'prompt_toolkit', 'best', 'random'),
choices=tuple(Shell.shell_type_aliases.keys()),
default=None)
p.add_argument('--timings',
help='Prints timing information before the prompt is shown. '

View file

@ -95,14 +95,18 @@ class Shell(object):
shell_type_aliases = {
'b': 'best',
'best': 'best',
'ptk': 'prompt_toolkit',
'ptk1': 'prompt_toolkit1',
'ptk2': 'prompt_toolkit2',
'prompt-toolkit': 'prompt_toolkit',
'prompt_toolkit': 'prompt_toolkit',
'prompt-toolkit1': 'prompt_toolkit1',
'prompt-toolkit2': 'prompt_toolkit2',
'rand': 'random',
'random': 'random',
'rl': 'readline',
'readline': 'readline',
}
def __init__(self, execer, ctx=None, shell_type=None, **kwargs):