def format_lists(lists)
      lists.inject([nil]) do |buf, (_, val)|
        opts = Kat::Search.send(val[:select])
        buf << val[:select].to_s.capitalize
        buf << nil unless opts.values.first.is_a? Array
        width = opts.keys.sort { |a, b| b.size <=> a.size }.first.size
        opts.each do |k, v|
          buf += if v.is_a? Array
                   [nil, "%#{ width }s => #{ v.shift }" % k] +
                     v.map { |e| ' ' * (width + 4) + e }
                 else
                   ["%-#{ width }s => #{ v }" % k]
                 end
        end
        buf << nil
      end
    end
def format_lists(lists)
      lists.inject([nil]) do |buf, (_, val)|
        opts = Kat::Search.send(val[:select])
        buf << val[:select].to_s.capitalize
        buf << nil unless opts.values.first.is_a? Array
        width = opts.keys.sort { |a, b| b.size <=> a.size }.first.size
        opts.each do |k, v|
          buf += if v.is_a? Array
                   [nil, "%#{ width }s => #{ v.shift }" % k] +
                     v.map { |e| ' ' * (width + 4) + e }
                 else
                   ["%-#{ width }s => #{ v }" % k]
                 end
        end
        buf << nil
      end
    end
Format a list of options