 
 // MARK: - UserServer
 
+public enum SSHAuthMethod {
+    case key(String)
+    // case password(String) TODO
+}
+
 extension Config {
-    public static var SSHKey: String = ""
+    public static var SSHAuthMethod: SSHAuthMethod? = nil
 }
 
 public class UserServer: ServerCommandExecutor {

    
    static var servers: [Server] = []
    
    public static func add(ip: String, user: String, roles: [ServerRole]) {
        servers.append(Server(ip: ip, user: user, roles: roles))
    }
    
    public static func add(SSHHost: String, roles: [ServerRole]) {

    
    public let ip: String
    public let user: String
    public let authMethod: SSHAuthMethod?
    
    public init(ip: String, user: String, authMethod: SSHAuthMethod?) {
        self.ip = ip
        self.user = user
        self.authMethod = authMethod
    }
    
    public func createArguments(for call: String) throws -> [String] {
        var args = ["/usr/bin/ssh", "-l", user]
        
        
        let auth: SSHAuthMethod
        if let authMethod = authMethod {
            auth = authMethod
        } else {
            guard let method = Config.SSHAuthMethod else {
                throw TaskError.error("You must either pass in a SSH auth method in your `Server.add` call or specify `Config.SSHAuthMethod` in your configuration file")
            }
            auth = method
        }
        
        switch auth {
        case let .key(key): args += ["-i" , key]
        }
        
        args += [ip, call]
        
        return args
    }
    
}
