Commit b463c4ca authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix +/- signs in front of warning types in help.

Quite a hack... something better is surely needed.
parent d226545e
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -25,18 +25,25 @@ module JsDuck
      @shown_warnings = {}
    end

    # Configures warnings to default settings.
    #
    # NB! Needs to be called before retrieving the documentation with
    # #doc_warnings (otherwise the +/- signs will be wrong).
    def configure_defaults
      # Enable all warnings except some.
      set_warning(:all, true)
      set_warning(:link_auto, false)
      set_warning(:param_count, false)
      set_warning(:fires, false)
      set_warning(:nodoc, false)
    end

    # Configures the logger with command line options.
    def configure(opts)
      self.verbose = true if opts.verbose

      self.colors = opts.color unless opts.color.nil?

      # Enable all warnings except the following:
      set_warning(:all, true)
      set_warning(:link_auto, false)
      set_warning(:param_count, false)
      set_warning(:fires, false)
      set_warning(:nodoc, false)
      begin
        opts.warnings.each do |w|
          set_warning(w[:type], w[:enabled], w[:path], w[:params])
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@ module JsDuck
      # Options::Record object, validates the options, applies it to
      # various singleton classes and returns the Options::Record.
      def self.process(args)
        # HACK! First establish warnings defaults.
        Logger.configure_defaults

        opts = Options::Parser.new.parse(args)

        # Expand list of input files