require 'optparse' require File.join(File.dirname(File.expand_path(__FILE__)), 'report') require File.join(File.dirname(File.expand_path(__FILE__)), 'reek_command') require File.join(File.dirname(File.expand_path(__FILE__)), 'help_command') require File.join(File.dirname(File.expand_path(__FILE__)), 'version_command') require File.join(File.dirname(File.expand_path(__FILE__)), 'yaml_command') require File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), 'source') module Reek module Cli # # Parses the command line # class Options def initialize(argv) @argv = argv @parser = OptionParser.new @report_class = VerboseReport @command_class = ReekCommand @config_files = [] set_options end def banner progname = @parser.program_name # SMELL: # The following banner isn't really correct. Help, Version and Reek # are really sub-commands (in the git/svn sense) and so the usage # banner should show three different command-lines. The other # options are all flags for the Reek sub-command. # # reek -h|--help Display a help message # # reek -v|--version Output the tool's version number # # reek [options] files List the smells in the given files # -c|--config file Specify file(s) with config options # -q|-[no-]quiet Only list files that have smells # files Names of files or dirs to be checked # return <