1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

new options: c, C, Q; default options

This commit is contained in:
Igor Chubin
2018-05-06 17:35:01 +00:00
parent 4f0cb9053f
commit 1308e97535
+7 -8
View File
@@ -7,7 +7,9 @@ def parse_args(args):
Parse arguments and options.
Replace short options with their long counterparts.
"""
result = {}
result = {
'add_comments': True,
}
query = ""
for key, val in args.items():
@@ -15,15 +17,12 @@ def parse_args(args):
query += key
continue
if 'T' in query:
result['no-terminal'] = True
if 'q' in query:
result['quiet'] = True
options_meaning = {
"c": dict(add_comments=True),
"C": dict(add_comments=False),
"c": dict(add_comments=False, unindent_code=False),
"C": dict(add_comments=False, unindent_code=True),
"Q": dict(remove_text=True),
'q': dict(quiet=True),
'T': {'no-terminal': True},
}
for option, meaning in options_meaning.items():
if option in query: