def expand_list(files, options = {})
      options = {
        preserve_duplicates: tester && tester.try(:sim?)
      }.merge(options)
      list_of_files = [files].flatten.map do |file|
        f = file.strip
        # Takes care of blank or comment lines in a list file
        if f.empty? || f =~ /^\s*#/
          nil
        # Don't expand program lists when submitting to lsf,
        # there are likely to be relational dependencies between
        # flows meaning that they must be generated together
        elsif is_a_list?(f) && !(options[:lsf] && options[:action] == :program)
          expand_list(open_list(f), options)
        else
          f
        end
      end.flatten.compact
      if options[:preserve_duplicates]
        list_of_files
      else
        list_of_files.uniq
      end
    end
def expand_list(files, options = {})
      options = {
        preserve_duplicates: tester && tester.try(:sim?)
      }.merge(options)
      list_of_files = [files].flatten.map do |file|
        f = file.strip
        # Takes care of blank or comment lines in a list file
        if f.empty? || f =~ /^\s*#/
          nil
        # Don't expand program lists when submitting to lsf,
        # there are likely to be relational dependencies between
        # flows meaning that they must be generated together
        elsif is_a_list?(f) && !(options[:lsf] && options[:action] == :program)
          expand_list(open_list(f), options)
        else
          f
        end
      end.flatten.compact
      if options[:preserve_duplicates]
        list_of_files
      else
        list_of_files.uniq
      end
    end
Returns an array of file/pattern names lines from a list file.
 This will also take care of recursively expanding any embedded
 list references.