require 'optparse' require 'reek' module Reek # SMELL: Greedy Module # This creates the command-line parser AND invokes it. And for the # -v and -h options it also executes them. And it holds the config # options for the rest of the application. class Options CTX_SORT = '%m%c %w (%s)' SMELL_SORT = '%m[%s] %c %w' def self.default_options { :format => CTX_SORT, :show_all => false, :quiet => false } end # SMELL: Global Variable @@opts = default_options def self.[](key) @@opts[key] end def initialize(argv) @argv = argv @parser = OptionParser.new set_options end def parse @parser.parse!(@argv) @argv end def set_options @parser.banner = <