1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2025-01-06 04:16:04 +03:00

ignore unkown color styles + :styles-demo

This commit is contained in:
Igor Chubin 2017-05-29 19:35:08 +00:00
parent aaa9828ab2
commit ea32116c27

View File

@ -35,7 +35,7 @@ from buttons import TWITTER_BUTTON, GITHUB_BUTTON, GITHUB_BUTTON_2, GITHUB_BUTTO
from adapter_learnxiny import get_learnxiny, get_learnxiny_list, is_valid_learnxy
# globals
INTERNAL_TOPICS = [":firstpage", ':post', ':bash_completion', ':help', ':styles']
INTERNAL_TOPICS = [":firstpage", ':post', ':bash_completion', ':help', ':styles', ':styles-demo']
LEXER = {
"go" : GoLexer,
"scala" : ScalaLexer,
@ -463,6 +463,8 @@ def cheat_wrapper(query, request_options=None, html=False):
highlight = not bool(request_options and request_options.get('no-terminal'))
color_style = request_options.get('style', '')
if color_style not in COLOR_STYLES:
color_style = ''
keyword = None
if '~' in query: