   }
 }
 
-func connect(password: String?, network: String?) -> Result<NSAppleEventDescriptor, QCError> {
-  return
-    validatePassword(password) &&& validateNetwork(network)
+func connect(password: String?, toNetwork network: String?) -> Result<NSAppleEventDescriptor, QCError> {
+  return validatePassword(password) &&& validateNetwork(network)
     >>- createScript
     >>- executeScript
 }

import Foundation

enum QCError: ErrorType {
  case PasswordNotFound
  case CouldNotCreateScript(String)
  case AppleScriptError(NSDictionary)
}

  case let .Failure(error): printErrorAndExit(error)
  }
}
else if arguments.hasOption(Option.setNetwork) {
  switch updateNetwork(arguments.argumentForOption(Option.setNetwork)) {
  case let .Success(confirmation): print(confirmation)
  case let .Failure(error): printErrorAndExit(error)
  }
}
else if arguments.hasOption(Option.help) {
  print(usage)
}
else if arguments.hasOption(Option.clear) {
  defaults.clear()
  print("Settings cleared! 🖖")
}
else {
  if let error = connect(defaults.password, toNetwork: defaults.network).error {
    printErrorAndExit(error)
  }
}
