Sha256: 55149385b0ad5c5c340dc03221a69dad9d805c997f986d864bad91ed3e32bbb3

Contents?: true

Size: 901 Bytes

Versions: 1

Compression:

Stored size: 901 Bytes

Contents

module Superhosting
  module Cli
    module Cmd
      class SiteList < Base
        option :container_name,
               :short => '-c NAME',
               :long  => '--container NAME',
               :required => false

        option :state,
               :long  => '--state',
               :boolean => true

        option :json,
               :long  => '--json',
               :boolean => true

        def self.after_action(data, config)
          data.each do |k,v|
            output = []
            output << v[:container] unless config[:container_name]
            output << k
            output << v[:state] if config[:state]

            if config[:json]
              self.info(name: k, state: v[:state], aliases: v[:aliases], container: v[:container])
            else
              self.info(output.join(' '))
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
superhosting-0.0.2 lib/superhosting/cli/cmd/site_list.rb