1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

minor sytax fixes

This commit is contained in:
Kelly Brazil
2020-03-04 12:03:40 -08:00
parent 19845624e2
commit 69576f6bfa

View File

@ -187,7 +187,7 @@ def magic():
"""Parse with magic syntax: jc -p ls -al""" """Parse with magic syntax: jc -p ls -al"""
if len(sys.argv) <= 1 or sys.argv[1].startswith('--'): if len(sys.argv) <= 1 or sys.argv[1].startswith('--'):
return return
parser_info = about_jc()['parsers'] parser_info = about_jc()['parsers']
# correctly parse escape characters and spaces with shlex # correctly parse escape characters and spaces with shlex
args_given = " ".join(map(shlex.quote, sys.argv[1:])).split() args_given = " ".join(map(shlex.quote, sys.argv[1:])).split()
@ -225,7 +225,7 @@ def magic():
pass pass
# second pass for one word commands: e.g. 'ls' # second pass for one word commands: e.g. 'ls'
elif args_given[0] in parser['magic_commands'] elif args_given[0] in parser['magic_commands']:
try: try:
found_parser = parser['argument'] found_parser = parser['argument']
break break
@ -263,7 +263,7 @@ def main():
debug = 'd' in options debug = 'd' in options
pretty = 'p' in options pretty = 'p' in options
quiet = 'q' in options quiet = 'q' in options
raw = 'r' in raw raw = 'r' in options
if 'a' in options: if 'a' in options:
json_out(about_jc(), pretty=pretty) json_out(about_jc(), pretty=pretty)