class Rexical::Cmd

def usage( msg=nil )

def usage( msg=nil )
  f  =  $stderr
  f.puts "#{@cmd}: #{msg}"  if msg
  f.print <<-EOT
age: #{@cmd} [options] <grammar file>
tions:
  EOT
  OPTIONS.each_line do |line|
    next if line.strip.empty?
    if /\A\s*\z/ === line
      f.puts
      next
    end
    disp, sopt, lopt, takearg, doc  =  line.strip.split(/\s+/, 5)
    if disp == 'o'
      sopt  =  nil if sopt == '-'
      lopt  =  nil if lopt == '-'
      opt  =  [sopt, lopt].compact.join(',')
      takearg  =  nil if takearg == '-'
      opt  =  [opt, takearg].compact.join(' ')
      f.printf "%-27s %s\n", opt, doc
    end
  end
  exit @status
end