lib/stf/view/cli.rb in stf-client-0.2.6 vs lib/stf/view/cli.rb in stf-client-0.3.0.pre.rc.12

- old
+ new

@@ -5,11 +5,11 @@ include GLI::App extend self - program_desc 'Smartphone Test Lab client' + program_desc "Smartphone Test Lab client (version #{Stf::VERSION})" desc 'Be verbose' switch [:v, :verbose] desc 'PID file' @@ -33,10 +33,13 @@ help_now!('Authorization token is required') if global_options[:token].nil? Log::verbose(global_options[:verbose]) DI.init(global_options) + + help_now!('Valid STF url is required, e.g. http(s)://openstf.local') if !DI[:uri_validator].validate(global_options[:url]) + true end desc 'Search for a device available in STF and attach it to local adb server' command :connect do |c| c.desc 'Connect to all available devices' @@ -45,26 +48,28 @@ c.flag [:n] c.desc 'Minimal quantity of devices, n/2 by default' c.flag [:min] c.desc 'Filter key:value for devices' c.flag [:f, :filter] + c.desc 'Force filter check for connected devices' + c.switch [:forcefilter, :ff] + c.desc 'Check selected health parameters, could be any of the: battery,temperature,network,vpn,wifi' + c.flag [:health] c.desc 'Maximum session duration in seconds, 10800 (3h) by default' c.flag [:session] c.desc 'Maximum time to connect minimal quantity of devices in seconds, 120 (2m) by default' c.flag [:starttime] - c.desc 'Maintain connactions before explicitly kill' - c.switch [:forever] c.desc 'Do not start daemon' c.switch [:nodaemon] c.action do |_, options, _| unless DI[:start_debug_session_interactor].execute(options) raise GLI::CustomExit.new('Connect failed', 1) end end end - desc 'Show avaliable keys for filtering' + desc 'Show available keys for filtering' command :keys do |c| c.action {puts DI[:get_keys_interactor].execute} end desc 'Show known values for the filtering key'