summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2015-03-23 16:14:18 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2015-03-23 16:14:18 -0700
commit5302305255732ddde8c88174a91d0e4ab56e7750 (patch)
treecadaae1f9ffba2c328c013a9fe1df939b3b507f5
parentbcea57afc38e6ae852ffa7df9f5fcab63e92ff0d (diff)
downloadgem5-5302305255732ddde8c88174a91d0e4ab56e7750.tar.xz
misc: quote args in echoed command line
Currently if there are shell special characters in a command-line argument, you can't copy and paste the echoed command line onto a shell prompt because the characters aren't quoted properly. This patch fixes that problem.
-rw-r--r--src/python/m5/main.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 29459cf64..700aae3d3 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -293,9 +293,9 @@ def main(*args):
datetime.datetime.now().strftime("%b %e %Y %X")
print "gem5 executing on %s" % socket.gethostname()
- print "command line:",
- for argv in sys.argv:
- print argv,
+ # in Python 3 pipes.quote() is moved to shlex.quote()
+ import pipes
+ print "command line:", " ".join(map(pipes.quote, sys.argv))
print
# check to make sure we can find the listed script