Class: Syncthing::Helper::CLI::DeviceReadCommand

Inherits:
AbstractCommand
  • Object
show all
Defined in:
lib/syncthing/helper/cli/device_command.rb

Instance Method Summary collapse

Methods included from InstanceMethods

#col, #delete_record, #query, #tabled_stdout, #trigger_updates

Instance Method Details

#executeObject



19
20
21
22
23
24
25
# File 'lib/syncthing/helper/cli/device_command.rb', line 19

def execute
  super
  col = 'devices'
  docs = API::Firestore.col(col).get.map(&:document_id)
  res = docs.map{|d| dr = API::Firestore.doc(col + '/' + d).get.data; [dr[:device_id], dr[:label]]}
  tabled_stdout header: ['Device Id', 'Label'], rows: res
end