lib/stf/view/cli.rb in stf-client-0.3.0.rc10 vs lib/stf/view/cli.rb in stf-client-0.3.0

- 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' @@ -48,10 +48,14 @@ 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 'Do not start daemon' @@ -94,9 +98,22 @@ end desc 'Frees all devices that are assigned to current user in STF. Doesn\'t modify local adb' command :clean do |c| c.action {DI[:remove_all_user_devices_interactor].execute} + end + + desc 'Add adb public key into STF' + command :trustme do |c| + c.desc 'Location of adb public key' + c.flag [:k, :adb_public_key_location] + c.default_value '~/.android/adbkey.pub' + + c.action do |_, options, _| + filename = File.expand_path(options[:adb_public_key_location]) + exit_now!("File does not exist: '#{options[:adb_public_key_location]}'") unless File.exist? filename + DI[:add_adb_public_key_interactor].execute(options[:adb_public_key_location]) + end end exit run(ARGV) end end