@@ -51,18 +51,18 @@ def parse_options():
5151
5252up_group .add_option ('-s' , '--servers' , metavar = "SERVERS" , nargs = 1 ,
5353action = 'store' , dest = 'servers' , type = 'int' , default = 5 ,
54- help = "number of servers to start" )
54+ help = "number of servers to start (default: 5) " )
5555up_group .add_option ('-g' , '--group' , metavar = "GROUP" , nargs = 1 ,
5656action = 'store' , dest = 'group' , type = 'string' , default = 'staging' ,
57- help = "the security group to run the instances under" )
57+ help = "the security group to run the instances under (default: staging) " )
5858up_group .add_option ('-z' , '--zone' , metavar = "ZONE" , nargs = 1 ,
5959action = 'store' , dest = 'zone' , type = 'string' , default = 'us-east-1d' ,
60- help = "the availability zone to start the instances in (e.g. us-east-1d)" )
60+ help = "the availability zone to start the instances in (default: us-east-1d)" )
6161up_group .add_option ('-i' , '--instance' , metavar = "INSTANCE" , nargs = 1 ,
6262action = 'store' , dest = 'instance' , type = 'string' , default = 'ami-ff17fb96' ,
63- help = "the instance-id to start each server from (e.g. ami-ff17fb96)" )
63+ help = "the instance-id to start each server from (default ami-ff17fb96)" )
6464up_group .add_option ('-k' , '--key' , metavar = "KEY" , nargs = 1 ,
65- action = 'store' , dest = 'key' , type = 'string' , default = 'frakkingtoasters' ,
65+ action = 'store' , dest = 'key' , type = 'string' ,
6666help = "the ssh key pair name to use to connect to the new servers" )
6767
6868parser .add_option_group (up_group )
@@ -71,11 +71,11 @@ def parse_options():
7171
7272attack_group .add_option ('-n' , '--number' , metavar = "NUMBER" , nargs = 1 ,
7373action = 'store' , dest = 'number' , type = 'int' , default = 1000 ,
74- help = "number of total connections to make to the target" )
74+ help = "number of total connections to make to the target (default: 1000) " )
7575
7676attack_group .add_option ('-c' , '--concurrent' , metavar = "CONCURRENT" , nargs = 1 ,
7777action = 'store' , dest = 'concurrent' , type = 'int' , default = 100 ,
78- help = "number of concurrent connections to make to the target" )
78+ help = "number of concurrent connections to make to the target (default: 100) " )
7979
8080attack_group .add_option ('-u' , '--url' , metavar = "URL" , nargs = 1 ,
8181action = 'store' , dest = 'url' , type = 'string' ,
@@ -91,10 +91,13 @@ def parse_options():
9191command = args [0 ]
9292
9393if command == "up" :
94+ if not options .key :
95+ parser .error ('To spin up new instances you need to specify a key-pair name with -k' )
96+
9497bees .up (options .servers , options .group , options .zone , options .instance , options .key )
9598elif command == "attack" :
96- if 'url' not in options :
97- parser .error ("To run an attack you need to specify a url" )
99+ if not options . url :
100+ parser .error ("To run an attack you need to specify a url with -u " )
98101
99102bees .attack (options .url , options .number , options .concurrency )
100103elif command == "down" :
0 commit comments