src/Pure/General/ssh.scala
changeset 64185 f4d5eb78b8a5
parent 64166 44925cf6ded1
child 64190 c62b99e3ec07
--- a/src/Pure/General/ssh.scala	Thu Oct 13 11:22:27 2016 +0200
+++ b/src/Pure/General/ssh.scala	Thu Oct 13 11:43:40 2016 +0200
@@ -17,9 +17,9 @@
 
 object SSH
 {
-  /* user@host syntax */
+  /* target machine: user@host syntax */
 
-  object User_Host
+  object Target
   {
     val Pattern = "^([^@]+)@(.+)$".r
 
@@ -30,10 +30,10 @@
       }
 
     def unapplySeq(s: String): Option[List[String]] =
-    {
-      val (user, host) = parse(s)
-      Some(List(user, host))
-    }
+      parse(s) match {
+        case (_, "") => None
+        case (user, host) => Some(List(user, host))
+      }
   }
 
   val default_port = 22