Sha256: dc6868bf7d56361545efee81866f30906a744b8c92a5e40a5b8981593cf09a0f

Contents?: true

Size: 428 Bytes

Versions: 12

Compression:

Stored size: 428 Bytes

Contents

desc 'Create a new cloud ip'
command [:create] do |c|
  c.desc "Number of cloud ips to create"
  c.default_value 1
  c.flag [:i, "count"]

  c.action do |global_options, options, args|

    if options[:i].to_s !~ /^[0-9]+$/
      raise "count must be a number"
    end

    options[:i] = options[:i].to_i

    ips = []
    options[:i].times do
      ips << CloudIP.create
    end
    render_table(ips, global_options)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bbcloud-0.11.2 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.11.1 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.11.0 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.10.1 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.9.2 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.9.1 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.9 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.8.2 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.8.1 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.8 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.7 lib/bbcloud/commands/cloudips-create.rb
bbcloud-0.6.2 lib/bbcloud/commands/cloudips-create.rb