def prompt_bash(msg: str, allow_empty: bool) -> str:
"""
Prompts for bash shell code.
:param msg: shown message
:param allow_empty: allow an empty string?
:return: user input
"""
from pygments.lexers.shell import BashLexer
validator = None if allow_empty else NonEmptyValidator()
return prompt(msg, lexer=PygmentsLexer(BashLexer), completer=SystemCompleter())
评论列表
文章目录