def cli():
history = InMemoryHistory()
style = style_from_pygments(get_style_by_name('monokai'))
lexer = PygmentsLexer(DiscogsCliLexer)
completer = Completer(fuzzy_match=False, text_utils=TextUtils())
SYNTAX = 'Syntax: ogs <command> [options]'
click.secho(' _ _ _ _ ',
fg='yellow')
click.secho(' __| (_)___ ___ ___ __ _ ___ ___| (_)',
fg='yellow')
click.secho(' / _` | / __|/ __/ _ \ / _` / __|_____ / __| | |',
fg='yellow')
click.secho('| (_| | \__ \ (_| (_) | (_| \__ \_____| (__| | |',
fg='yellow')
click.secho(' \__,_|_|___/\___\___/ \__, |___/ \___|_|_|',
fg='yellow')
click.secho(' |___/', fg='yellow')
click.echo('Version:' + __version__)
click.echo(SYNTAX)
while True:
try:
text = prompt('discogs-cli >>> ', style=style, history=history,
lexer=lexer, completer=completer,
complete_while_typing=Always())
except EOFError:
break
if text in EXIT:
break
if text.startswith(TOKEN):
execute(text)
else:
click.secho('Guru meditation error. ' + SYNTAX, fg='red')
评论列表
文章目录