summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Brown <ryansb@csh.rit.edu>2011-07-01 10:49:25 -0700
committerRyan Brown <ryansb@csh.rit.edu>2011-07-01 10:49:25 -0700
commit9c7a4cdaab2d0c1e9b74a213c01696ec07a67d81 (patch)
treeb1678b8ed5e2e56da3bb8eb28b812d741ad55bf0
parentac49d3f5b0e2ad1be5ea924a53071f1fcdcaf27e (diff)
downloadboto-9c7a4cdaab2d0c1e9b74a213c01696ec07a67d81.tar.gz
Made both '-s x -s y' and '-s x,y' notation work for the -s option
-rwxr-xr-xbin/launch_instance12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/launch_instance b/bin/launch_instance
index 1690b9a7..d3c9f24e 100755
--- a/bin/launch_instance
+++ b/bin/launch_instance
@@ -79,8 +79,16 @@ class Config(boto.pyami.config.Config):
self.write(s)
return s.getvalue()
+SCRIPTS = []
+
def scripts_callback(option, opt, value, parser):
- setattr(parser.values, option.dest, value.split(','))
+ arg = value.split(',')
+ if len(arg) == 1:
+ SCRIPTS.append(arg[0])
+ else:
+ SCRIPTS.extend(arg)
+ print SCRIPTS
+ setattr(parser.values, option.dest, SCRIPTS)
def add_script(scr_url):
"""Read a script and any scripts that are added using #import"""
@@ -94,7 +102,7 @@ def add_script(scr_url):
#Read the other script and put it in that spot
script_content += add_script("%s/%s" % (base_url, match.group(1)))
else:
- #Otherwise, just add the line and move on
+ #As long as it's not the shebang line, add it and move on
script_content += line
return script_content