From 81a27b9c88ca07a5860d18f8b1579dbd253d87ed Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 14 Mar 2012 19:09:44 -0400 Subject: [PATCH] Fix the copy module to use the argsfile method --- copy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/copy b/copy index 288929a89a8..632df966486 100755 --- a/copy +++ b/copy @@ -32,8 +32,14 @@ except ImportError: # to a dictionary # FIXME: make more idiomatic -args = " ".join(sys.argv[1:]) -items = shlex.split(args) +if len(sys.argv) == 1: + sys.exit(1) +argfile = sys.argv[1] +if not os.path.exists(argfile): + sys.exit(1) +items = shlex.split(open(argfile, 'r').read()) + + params = {} for x in items: (k, v) = x.split("=")