class Rouge::CLI::List

def self.desc

def self.desc
  "list available lexers"
end

def self.doc

def self.doc
  return enum_for(:doc) unless block_given?
  yield %|usage: rouge list|
  yield %||
  yield %|print a list of all available lexers with their descriptions.|
end

def self.parse(argv)

def self.parse(argv)
  new
end

def run

def run
  puts "== Available Lexers =="
  Lexer.all.sort_by(&:tag).each do |lexer|
    desc = String.new("#{lexer.desc}")
    if lexer.aliases.any?
      desc << " [aliases: #{lexer.aliases.join(',')}]"
    end
    puts "%s: %s" % [lexer.tag, desc]
    lexer.option_docs.keys.sort.each do |option|
      puts "  ?#{option}= #{lexer.option_docs[option]}"
    end
    puts
  end
end