def build_cmd_ref
      # Example id's: N3K-C3048TP-1GE, N3K-C3064PQ-10GE, N7K-C7009, N7K-C7009
      debug "Product: #{@product_id}"
      debug "Files being used: #{@files.join(', ')}"

      @files.each do |file|
        feature = File.basename(file).split('.')[0]
        debug "Processing file '#{file}' as feature '#{feature}'"
        feature_hash = load_yaml(file)
        if feature_hash.empty?
          debug "Feature #{feature} is empty"
          next
        end
        begin
          feature_hash = filter_hash(feature_hash)
        rescue RuntimeError => e
          raise "#{file}: #{e}"
        end
        if feature_hash.empty?
          debug "Feature #{feature} is excluded"
          @hash[feature] = UnsupportedCmdRef.new(feature, nil, file)
          next
        end

        base_hash = {}
        if feature_hash.key?('_template')
          base_hash = CommandReference.hash_merge(feature_hash['_template'])
        end

        feature_hash.each do |name, value|
          fail "No entries under '#{name}' in '#{file}'" if value.nil?
          @hash[feature] ||= {}
          if value.empty?
            @hash[feature][name] = UnsupportedCmdRef.new(feature, name, file)
          else
            values = CommandReference.hash_merge(value, base_hash.clone)
            @hash[feature][name] = CmdRef.new(feature, name, values, file)
          end
        end
      end
    end
def build_cmd_ref
      # Example id's: N3K-C3048TP-1GE, N3K-C3064PQ-10GE, N7K-C7009, N7K-C7009
      debug "Product: #{@product_id}"
      debug "Files being used: #{@files.join(', ')}"

      @files.each do |file|
        feature = File.basename(file).split('.')[0]
        debug "Processing file '#{file}' as feature '#{feature}'"
        feature_hash = load_yaml(file)
        if feature_hash.empty?
          debug "Feature #{feature} is empty"
          next
        end
        begin
          feature_hash = filter_hash(feature_hash)
        rescue RuntimeError => e
          raise "#{file}: #{e}"
        end
        if feature_hash.empty?
          debug "Feature #{feature} is excluded"
          @hash[feature] = UnsupportedCmdRef.new(feature, nil, file)
          next
        end

        base_hash = {}
        if feature_hash.key?('_template')
          base_hash = CommandReference.hash_merge(feature_hash['_template'])
        end

        feature_hash.each do |name, value|
          fail "No entries under '#{name}' in '#{file}'" if value.nil?
          @hash[feature] ||= {}
          if value.empty?
            @hash[feature][name] = UnsupportedCmdRef.new(feature, name, file)
          else
            values = CommandReference.hash_merge(value, base_hash.clone)
            @hash[feature][name] = CmdRef.new(feature, name, values, file)
          end
        end
      end
    end
Constructor.
 Normal usage is to pass product, platform, data_formats,
 in which case usual YAML files will be located then the list
 will be filtered down to only those matching the given settings.
 For testing purposes (only!) you can pass an explicit list of files to
 load instead. This list will NOT be filtered further by product_id.
 Build complete reference hash.