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 14, 2015
1 parent 7b1f07c commit c4bbaba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
from io import StringIO
from io import BytesIO as cStringIO
from queue import Queue, Empty
from shlex import quote as shlex_quote

# for some reason, python 3.1 removed the builtin "callable", wtf
if not hasattr(__builtins__, "callable"):
Expand All @@ -67,6 +68,7 @@ def callable(ob):
from StringIO import StringIO
from cStringIO import OutputType as cStringIO
from Queue import Queue, Empty
from pipes import quote as shlex_quote

IS_OSX = platform.system() == "Darwin"
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -1332,7 +1334,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 c4bbaba

Please sign in to comment.