Method: MacWifi::CommandLineInterface#cmd_pa

Defined in:
lib/mac-wifi/command_line_interface.rb

#cmd_pa(network) ⇒ Object



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/mac-wifi/command_line_interface.rb', line 332

def cmd_pa(network)
  password = model.preferred_network_password(network)

  if interactive_mode
    password
  else
    if post_processor
      puts post_processor.(password)
    else
      output =  %Q{Preferred network "#{model.connected_network_name}" }
      output << (password ? %Q{stored password is "#{password}".} : "has no stored password.")
      puts output
    end
  end
end