Sha256: b1aa8b9c255ea9cb420f81fb7b33b6d37574e1992bc6fa48a3322fd77e5668a8
Contents?: true
Size: 865 Bytes
Versions: 18
Compression:
Stored size: 865 Bytes
Contents
module Brightbox command [:servers] do |cmd| cmd.default_command :list cmd.desc "List servers" cmd.arg_name "[server-id...]" cmd.command [:list] do |c| c.desc "Group identifier" c.flag %i[g group] c.action do |global_options, options, args| # Check this here before we make any network connections raise "A valid server group identifier is required for the group argument" unless options[:g].nil? || options[:g] =~ /^grp-.{5}$/ servers = Server.find_all_or_warn(args) # Scope by group if a group identifier is specified if options[:g] servers = servers.select do |server| server.server_groups.any? do |grp| grp["id"] == options[:g] end end end render_table(servers, global_options) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems