From fd411fd77273cb7cf872c03ed6a258ccdee4d261 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 16 May 2021 17:43:05 -0700 Subject: [PATCH] attempt to get colors working on windows --- jc/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index 13f8a51e..d2bd4c74 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -491,6 +491,9 @@ def main(): except AttributeError: pass + # enable colors for Windows cmd.exe terminal + os.system('') + # parse magic syntax first: e.g. jc -p ls -al magic_options = [] valid_command, run_command, magic_found_parser, magic_options = magic_parser(sys.argv) @@ -562,7 +565,7 @@ def main(): sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT)) elif run_command is not None: - jc.utils.error_message(f'Parser not found for "{run_command_str}". Use "jc -h" for help.') + jc.utils.error_message(f'"{run_command_str}" cannot be used with Magic syntax. Use "jc -h" for help.') sys.exit(combined_exit_code(magic_exit_code, JC_ERROR_EXIT)) # find the correct parser