Skip to content

Commit

Permalink
Dump the quoted version of the command to the screen.
Browse files Browse the repository at this point in the history
This lets you copy-paste the output which is convenient when debugging
these sorts of programs.
  • Loading branch information
Vitali Lovich committed May 22, 2015
1 parent 7b1f07c commit a9e19fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ def callable(ob):
from cStringIO import OutputType as cStringIO
from Queue import Queue, Empty

try:
# This is only as of python 3.3
from shlex import quote as shlex_quote
except ImportError:
from pipes import quote as shlex_quote

IS_OSX = platform.system() == "Darwin"
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
SH_LOGGER_NAME = "sh"
Expand Down Expand Up @@ -1332,7 +1338,7 @@ def __init__(self, parent_log, cmd, stdin, stdout, stderr, call_args, pipe):
if stderr is not OProc.STDOUT:
os.close(self._slave_stderr_fd)

self.log.debug('started "%r"', cmd)
self.log.info('started %s', ' '.join([shlex_quote(arg) for arg in cmd]))

if self.call_args["tty_in"]:
attr = termios.tcgetattr(self._stdin_fd)
Expand Down

0 comments on commit a9e19fa

Please sign in to comment.