Class: SimplyGenius::Atmos::CLI

Inherits:
Clamp::Command
  • Object
show all
Includes:
GemLogger::LoggerSupport
Defined in:
lib/simplygenius/atmos/cli.rb

Overview

The command line interface to atmos

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/simplygenius/atmos/cli.rb', line 19

def self.description
  desc = <<-DESC
    Atmos version #{VERSION}
    
    Runs The atmos command line application
    
    e.g.
    
    atmos --help
  DESC
  desc.split("\n").collect(&:strip).join("\n")
end

Instance Method Details

#default_color?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/simplygenius/atmos/cli.rb', line 51

def default_color?
   $stdout.tty?
end

#parse(arguments) ⇒ Object

hook into clamp lifecycle to force logging setup even when we are calling a subcommand



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/simplygenius/atmos/cli.rb', line 103

def parse(arguments)
  super
  if Atmos.config.nil?
    Atmos.config = Config.new(atmos_env, atmos_group)
    log = Atmos.config.is_atmos_repo? && log? ? "atmos.log" : nil
    Logging.setup_logging(debug?, color?, log)
    UI.color_enabled = color?

    Atmos.config.add_user_load_path(*load_path_list)
    Atmos.config.plugin_manager.register_output_filter(:stdout, Plugins::PromptNotify)
    Atmos.config.plugin_manager.load_plugins
  end
end