@@ -2,6 +2,8 @@ module Test
22
33 # Command line interface to test runner.
44 #
5+ # TODO: Use `cli` based library instead of option parse.
6+ #
57 class CLI
68
79 #
@@ -51,6 +53,14 @@ def run(argv=nil)
5153 #end
5254 end
5355
56+ # These options are parsed prior to any other options.
57+ #
58+ # TODO: Certain opitons should be parsed before others.
59+ # Some aren't even useful if not, use as -R.
60+ def preoptions
61+
62+ end
63+
5464 #
5565 # Setup OptionsParser instance.
5666 #
@@ -61,9 +71,6 @@ def options
6171 opt . banner = "Usage: #{ File . basename ( $0) } [options] [files ...]"
6272
6373 #opt.separator "PRESET OPTIONS:"
64- #opt.on '-c', '--config FILE', "require local config file" do |file|
65- # require_config(file)
66- #end
6774 #pnames = profile_names
6875 #unless pnames.empty?
6976 # pnames.each do |pname|
@@ -92,19 +99,25 @@ def options
9299 config . match << text
93100 end
94101
95- opt . on '-a ' , '--autopath' , 'automatically add paths to $LOAD_PATH' do |paths |
102+ opt . on '-A ' , '--autopath' , 'automatically add paths to $LOAD_PATH' do |paths |
96103 config . autopath = true
97104 end
98105 opt . on '-I' , '--loadpath PATH' , 'add given path to $LOAD_PATH' do |paths |
99106 paths . split ( /[:;]/ ) . reverse_each do |path |
100107 $LOAD_PATH. unshift path
101108 end
102109 end
110+ #opt.on '-C', '--chdir DIR', 'change directory before running tests' do |dir|
111+ # config.chdir = dir
112+ #end
113+ #opt.on '-R', '--chroot', 'change to project root directory before running tests' do |bool|
114+ # config.chroot = bool
115+ #end
103116 opt . on '-r' , '--require FILE' , 'require file (immediately)' do |file |
104117 require file
105118 end
106- opt . on '-p ' , '--profile FILE' , "require local profile " do |file |
107- Config . require_profile ( file )
119+ opt . on '-c ' , '--config FILE' , "require local config file " do |file |
120+ Config . require_config ( file )
108121 end
109122 opt . on '-d' , '--details' , 'provide extra detail in reports' do
110123 config . verbose = true
0 commit comments