lib/artoo/commands/connect.rb in artoo-1.1.0.pre vs lib/artoo/commands/connect.rb in artoo-1.1.0

- old
+ new

@@ -9,13 +9,16 @@ desc "scan", "Scan for connected devices" option :type, :aliases => "-t", :default => "bluetooth", :desc => "type of scan [bluetooth, serial]" def scan case os when :linux - if options[:type] == 'bluetooth' + case options[:type] + when 'bluetooth' run("hcitool scan") - elsif options[:type] == 'serial' + when 'serial' run("ls /dev/tty*") + when 'usb' + run("lsusb") else say "ERROR: scan type '#{options[:type]}' not supported!" end when :macosx run("ls /dev/tty*")