Flowdock
method

compsys

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: OptionParser::Switch
compsys(sdone, ldone) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/optparse.rb, line 444
    def compsys(sdone, ldone)   # :nodoc:
      sopts, lopts = [], []
      @short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short
      @long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long
      return if sopts.empty? and lopts.empty? # completely hidden

      (sopts+lopts).each do |opt|
        # "(-x -c -r)-l[left justify]" \
        if opt =~ /^--\[no-\](.+)$/
          o = $1
          yield("--#{o}", desc.join(""))
          yield("--no-#{o}", desc.join(""))
        else
          yield("#{opt}", desc.join(""))
        end
      end
    end
Register or log in to add new notes.