bin/tl in testlab-0.7.4 vs bin/tl in testlab-0.7.5

- old
+ new

@@ -16,12 +16,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ################################################################################ -require 'socket' - require 'gli' require 'testlab' include GLI::App include TestLab::Utility::Misc @@ -32,51 +30,53 @@ # program_long_desc %(Program Long Description) sort_help :manually default_command :help +preserve_argv true + commands_from 'commands' desc 'Show verbose output' default_value false switch [:v, :verbose] desc 'Quiet mode' default_value false switch [:q, :quiet] -desc 'Path to Labfile: ${PWD}/Labfile' +desc 'Path to Labfile: ${REPO}/Labfile' arg_name 'path/to/file' -default_value File.join(Dir.pwd, 'Labfile') +# default_value File.join(Dir.pwd, 'Labfile') flag [:l, :labfile] desc 'Path to Repository directory: ${PWD}' arg_name 'path/to/directory' default_value Dir.pwd flag [:r, :repo] -desc 'Path to Configuration directory: ${PWD}/.testlab-$(hostname -s)' +desc 'Path to Configuration directory: ${REPO}/.testlab-$(hostname -s)' arg_name 'path/to/directory' -default_value File.join(Dir.pwd, ".testlab-#{TestLab.hostname}") +# default_value File.join(Dir.pwd, ".testlab-#{TestLab.hostname}") flag [:c, :config] pre do |global,command,options,args| (global[:verbose] == true) and (ENV['LOG_LEVEL'] = 'DEBUG') - log_file = File.join(Dir.pwd, "testlab-#{TestLab.hostname}.log") + log_file = File.join(global[:repo], "testlab-#{TestLab.hostname}.log") @logger = ZTK::Logger.new(log_file) @ui = ZTK::UI.new( :logger => @logger, :verbose => global[:verbose], :quiet => global[:quiet] ) @testlab = TestLab.new( :ui => @ui, - :labfile => global[:labfile], - :config_dir => global[:config], - :repo_dir => global[:repo] + :labfile_path => global[:labfile], + :config_dir => global[:config], + :repo_dir => global[:repo] ) @ui.logger.debug { "global(#{global.inspect})" } @ui.logger.debug { "options(#{options.inspect})" } @ui.logger.debug { "args(#{args.inspect})" }