# File lib/simp/cli/commands/config.rb, line 252
  def self.run(args = [])
    super # parse @options, will raise upon parsing error
    return if @help_requested
    @options[:start_time] = Time.now

    set_up_logger

    # Ensure that custom facts are available before the first pluginsync
    if ::Utils.puppet_info[:config]['modulepath']  # nil in spec tests with Puppet 4
      ::Utils.puppet_info[:config]['modulepath'].split(':').each do |dir|
        next unless File.directory?(dir)
        Find.find(dir) do |mod_path|
          fact_path = File.expand_path('lib/facter', mod_path)
          Facter.search(fact_path) if File.directory?(fact_path)
          Find.prune unless mod_path == dir
        end
      end
    end

    # Read in and merge sets of answers (predetermined settings) to result
    # in the following priority
    # 1. answers from the command line
    # 2. answers from an interrupted session
    # 3. answers from the input answers file
    # 4. answers from the scenario file

    # Retrieve set of answers set at command line via tag=value pairs
    cli_answers = {}
    cli_answers  = Hash[ args.map{ |x| x.split '=' } ]

    # Retrieve partial set of answers from a previous interrupted session   
    interrupted_session_answers = saved_session

    # Retrieve set of answers from an input answers file
    file_answers = {}
    if @options.fetch(:answers_input_file)
      file_answers = read_answers_file( @options.fetch(:answers_input_file) )
    end

    # Merge what has been read in so far to see if scenario is defined yet
    answers_hash = (file_answers.merge(interrupted_session_answers)).merge(cli_answers)

    # greet user before any prompts
    logger.info( "\n#{INTRO_TEXT.chomp}", [:GREEN] )
    logger.info( "#{' '*15}#{@options[:log_file]}")
    logger.info( '='*80 + "\n", [:GREEN] )

    # Retrieve set of answer from a scenario file, prompting for scenario if needed
    unless answers_hash['cli::simp::scenario']
      # prompt user so we can figure out which yaml file to read
      # NOTE:  In order to persist the 'cli::simp::scenario' key in the output answers
      # yaml file, CliSimpScenario will also be in the item decision tree.  However,
      # in that tree, it will be configured with the 'SKIPQUERY SILENT' options, so that
      # the user isn't prompted twice.
      item = Simp::Cli::Config::Item::CliSimpScenario.new
      item.query
      answers_hash['cli::simp::scenario'] =  item.value
    end
    scenario_hiera_file = File.join(::Utils.puppet_info[:simp_environment_path],
        'hieradata', 'scenarios', "#{answers_hash['cli::simp::scenario']}.yaml")
    unless File.exist?(scenario_hiera_file)
      # If SIMP is installed via RPMs but not the ISO and the copy
      # hasn't been made yet, the scenario YAML file should be able
      # to be found in /usr/share/simp instead.
      alt_scenario_hiera_file = File.join('/', 'usr', 'share', 'simp',
        'environments','simp', 'hieradata', 'scenarios',
        "#{answers_hash['cli::simp::scenario']}.yaml")
      scenario_hiera_file = alt_scenario_hiera_file if File.exist?(alt_scenario_hiera_file)
    end
    scenario_answers = read_answers_file( scenario_hiera_file )
    answers_hash = scenario_answers.merge(answers_hash)

    # Get the list (decision tree) of items
    #  - applies any known answers at this point
    item_list = Simp::Cli::Config::ItemListFactory.new( @options ).process( answers_hash )

    # Process item tree:
    #  - get any remaining answers from user
    #  - apply changes as needed
    questionnaire = Simp::Cli::Config::Questionnaire.new( @options )
    answers = questionnaire.process( item_list, {} )
    print_summary(answers) if answers

    logger.say( "\n<%= color(%q{Detailed log written to #{@options[:log_file]}}, BOLD) %>" )

    remove_saved_session
  end