Class: Omnizip::Commands::ProfileListCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/commands/profile_list_command.rb

Overview

Command to list available compression profiles

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ProfileListCommand

Returns a new instance of ProfileListCommand.



7
8
9
# File 'lib/omnizip/commands/profile_list_command.rb', line 7

def initialize(options = {})
  @options = options
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
# File 'lib/omnizip/commands/profile_list_command.rb', line 11

def run
  profiles = Omnizip::Profile.registry.all.sort_by(&:name)

  if @options[:verbose]
    list_detailed(profiles)
  else
    list_simple(profiles)
  end
end