def educate(stream = $stdout)
    width # hack: calculate it now; otherwise we have to be careful not to
          # call this unless the cursor's at the beginning of a line.
    left = {}
    @specs.each do |name, spec|
      left[name] =
        (spec[:short] && spec[:short] != :none ? "-#{spec[:short]}" : "") +
        (spec[:short] && spec[:short] != :none ? ", " : "") + "--#{spec[:long]}" +
        case spec[:type]
        when :flag    then ""
        when :int     then "=<i>"
        when :ints    then "=<i+>"
        when :string  then "=<s>"
        when :strings then "=<s+>"
        when :float   then "=<f>"
        when :floats  then "=<f+>"
        when :io      then "=<filename/uri>"
        when :ios     then "=<filename/uri+>"
        when :date    then "=<date>"
        when :dates   then "=<date+>"
        end +
        (spec[:type] == :flag && spec[:default] ? ", --no-#{spec[:long]}" : "")
    end

    leftcol_width = left.values.map(&:length).max || 0
    rightcol_start = leftcol_width + 6 # spaces

    unless @order.size > 0 && @order.first.first == :text
      command_name = File.basename($0).gsub(/\.[^.]+$/, '')
      stream.puts "Usage: #{command_name} #{@usage}\n" if @usage
      stream.puts "#{@synopsis}\n" if @synopsis
      stream.puts if @usage || @synopsis
      stream.puts "#{@version}\n" if @version
      stream.puts "Options:"
    end

    @order.each do |what, opt|
      if what == :text
        stream.puts wrap(opt)
        next
      end

      spec = @specs[opt]
      stream.printf "  %-#{leftcol_width}s    ", left[opt]
      desc = spec[:desc] + begin
        default_s = case spec[:default]
        when $stdout   then "<stdout>"
        when $stdin    then "<stdin>"
        when $stderr   then "<stderr>"
        when Array
          spec[:default].join(", ")
        else
          spec[:default].to_s
        end

        if spec[:default]
          if spec[:desc] =~ /\.$/
            " (Default: #{default_s})"
          else
            " (default: #{default_s})"
          end
        else
          ""
        end
      end
      stream.puts wrap(desc, :width => width - rightcol_start - 1, :prefix => rightcol_start)
    end
  end
def educate(stream = $stdout)
    width # hack: calculate it now; otherwise we have to be careful not to
          # call this unless the cursor's at the beginning of a line.
    left = {}
    @specs.each do |name, spec|
      left[name] =
        (spec[:short] && spec[:short] != :none ? "-#{spec[:short]}" : "") +
        (spec[:short] && spec[:short] != :none ? ", " : "") + "--#{spec[:long]}" +
        case spec[:type]
        when :flag    then ""
        when :int     then "=<i>"
        when :ints    then "=<i+>"
        when :string  then "=<s>"
        when :strings then "=<s+>"
        when :float   then "=<f>"
        when :floats  then "=<f+>"
        when :io      then "=<filename/uri>"
        when :ios     then "=<filename/uri+>"
        when :date    then "=<date>"
        when :dates   then "=<date+>"
        end +
        (spec[:type] == :flag && spec[:default] ? ", --no-#{spec[:long]}" : "")
    end

    leftcol_width = left.values.map(&:length).max || 0
    rightcol_start = leftcol_width + 6 # spaces

    unless @order.size > 0 && @order.first.first == :text
      command_name = File.basename($0).gsub(/\.[^.]+$/, '')
      stream.puts "Usage: #{command_name} #{@usage}\n" if @usage
      stream.puts "#{@synopsis}\n" if @synopsis
      stream.puts if @usage || @synopsis
      stream.puts "#{@version}\n" if @version
      stream.puts "Options:"
    end

    @order.each do |what, opt|
      if what == :text
        stream.puts wrap(opt)
        next
      end

      spec = @specs[opt]
      stream.printf "  %-#{leftcol_width}s    ", left[opt]
      desc = spec[:desc] + begin
        default_s = case spec[:default]
        when $stdout   then "<stdout>"
        when $stdin    then "<stdin>"
        when $stderr   then "<stderr>"
        when Array
          spec[:default].join(", ")
        else
          spec[:default].to_s
        end

        if spec[:default]
          if spec[:desc] =~ /\.$/
            " (Default: #{default_s})"
          else
            " (default: #{default_s})"
          end
        else
          ""
        end
      end
      stream.puts wrap(desc, :width => width - rightcol_start - 1, :prefix => rightcol_start)
    end
  end
Print the help message to +stream+.