From 4c2912d3d5ec1fd2d5d891f2b3c58a33dd8572be Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 13 Aug 2021 15:19:17 -0700 Subject: [PATCH] use shlex.join to quote run_command_str for better error messages --- jc/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jc/cli.py b/jc/cli.py index 40e74d3d..5c35d9a7 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -9,6 +9,7 @@ import re import importlib import textwrap import signal +import shlex import subprocess import json import jc @@ -547,7 +548,7 @@ def main(): # if magic syntax used, try to run the command and error if it's not found, etc. magic_stdout, magic_stderr, magic_exit_code = None, None, 0 if run_command: - run_command_str = ' '.join(run_command) + run_command_str = shlex.join(run_command) if valid_command: try: