The command-line interface to Assemblage.
Add the commands from the registered subcommand modules.
# File lib/assemblage/cli.rb, line 134
def self::add_registered_subcommands
        self.subcommand_modules ||= []
        self.subcommand_modules.each do |mod|
                merged_commands = mod.commands.merge( self.commands )
                self.commands.update( merged_commands )
                command_objs = self.commands_declaration_order | self.commands.values
                self.commands_declaration_order.replace( command_objs )
        end
end
						Load commands from any files in the specified directory relative to LOAD_PATHs
# File lib/assemblage/cli.rb, line 357
def self::commands_from( subdir )
        Gem.find_latest_files( File.join(subdir, '*.rb') ).each do |rbfile|
                self.log.debug "  loading %s..." % [ rbfile ]
                require( rbfile )
        end
end
						Load the config file using either assemblage-base's config-loader if available, or fall back to DEFAULT_CONFIG_FILE
# File lib/assemblage/cli.rb, line 207
def self::load_config( global={} )
        Assemblage.load_config( global[:c] ) if global[:c]
        # Set up the logging formatter
        Loggability.format_with( :color ) if $stdout.tty?
end
						Return the Pastel colorizer.
# File lib/assemblage/cli.rb, line 147
def self::pastel
        @pastel ||= Pastel.new( enabled: $stdout.tty? )
end
						Return the TTY prompt used by the command to communicate with the user.
# File lib/assemblage/cli.rb, line 154
def self::prompt
        @prompt ||= TTY::Prompt.new
end
						Add the specified +mod+ule containing subcommands to the 'assemblage' command.
# File lib/assemblage/cli.rb, line 125
def self::register_subcommands( mod )
        self.subcommand_modules ||= []
        self.subcommand_modules.push( mod )
        mod.extend( GLI::DSL, GLI::AppSupport, Loggability )
        mod.log_to( :assemblage )
end
						Load any additional Ruby libraries given with the -r global option.
# File lib/assemblage/cli.rb, line 177
def self::require_additional_libs( requires)
        requires.each do |path|
                path = "assemblage/#{path}" unless path.start_with?( 'assemblage/' )
                require( path )
        end
end
						Discard the existing HighLine prompt object if one existed. Mostly useful for testing.
# File lib/assemblage/cli.rb, line 161
def self::reset_prompt
        @prompt = nil
end
						Overridden – Add registered subcommands immediately before running.
# File lib/assemblage/cli.rb, line 118
def self::run( * )
        self.add_registered_subcommands
        super
end
						Set the global logging level if it's defined.
# File lib/assemblage/cli.rb, line 167
def self::set_logging_level( level=nil )
        if level
                Loggability.level = level.to_sym
        else
                Loggability.level = :fatal
        end
end
						Set up the output levels and globals based on the associated
global options.
# File lib/assemblage/cli.rb, line 216
def self::setup_output( global )
        # Turn on Ruby debugging and/or verbosity if specified
        if global[:n]
                $DRYRUN = true
                Loggability.level = :warn
        else
                $DRYRUN = false
        end
        if global[:verbose]
                $VERBOSE = true
                Loggability.level = :info
        end
        if global[:debug]
                $DEBUG = true
                Loggability.level = :debug
        end
end
						Setup pastel color aliases
# File lib/assemblage/cli.rb, line 187
def self::setup_pastel_aliases
        self.pastel.alias_color( :headline, :bold, :white, :on_black )
        self.pastel.alias_color( :success, :bold, :green )
        self.pastel.alias_color( :error, :bold, :red )
        self.pastel.alias_color( :up, :green )
        self.pastel.alias_color( :down, :red )
        self.pastel.alias_color( :unknown, :dark, :yellow )
        self.pastel.alias_color( :disabled, :dark, :white )
        self.pastel.alias_color( :quieted, :dark, :green )
        self.pastel.alias_color( :acked, :yellow )
        self.pastel.alias_color( :highlight, :bold, :yellow )
        self.pastel.alias_color( :search_hit, :black, :on_white )
        self.pastel.alias_color( :prompt, :cyan )
        self.pastel.alias_color( :even_row, :bold )
        self.pastel.alias_color( :odd_row, :reset )
end
						Registered subcommand modules
# File lib/assemblage/cli.rb, line 114
singleton_attr_accessor :subcommand_modules