lib/swa/cli/ec2_command.rb in swa-0.4.0 vs lib/swa/cli/ec2_command.rb in swa-0.4.1

- old
+ new

@@ -15,44 +15,10 @@ module Swa module CLI class Ec2Command < BaseCommand - subcommand ["key-pair", "kp"], "Show key-pair" do - - parameter "NAME", "key-pair name" - - include ItemBehaviour - - private - - def key_pair - Swa::EC2::KeyPair.new(ec2.key_pair(name)) - end - - alias_method :item, :key_pair - - end - - subcommand ["key-pairs", "kps"], "List key-pairs" do - - self.description = <<-EOF - List key-pairs. - EOF - - include CollectionBehaviour - - private - - def key_pairs - query_for(:key_pairs, Swa::EC2::KeyPair) - end - - alias_method :collection, :key_pairs - - end - subcommand ["image", "ami"], "Show image" do parameter "IMAGE-ID", "image id" include ItemBehaviour @@ -214,9 +180,43 @@ add_filter("instance-state-name", state) query_for(:instances, Swa::EC2::Instance) end alias_method :collection, :instances + + end + + subcommand ["key-pair", "kp"], "Show key-pair" do + + parameter "NAME", "key-pair name" + + include ItemBehaviour + + private + + def key_pair + Swa::EC2::KeyPair.new(ec2.key_pair(name)) + end + + alias_method :item, :key_pair + + end + + subcommand ["key-pairs", "kps"], "List key-pairs" do + + self.description = <<-EOF + List key-pairs. + EOF + + include CollectionBehaviour + + private + + def key_pairs + query_for(:key_pairs, Swa::EC2::KeyPair) + end + + alias_method :collection, :key_pairs end subcommand ["security-group", "sg"], "Show security-group" do