Does this handle the case where the val string contains an "="? You might use `.split("=", 2)`. You could also refactor this to something like:
```scala
input.drop(3).split("=", 2).map(_.trim) match {
  case Array() | Array("") => // "set"
    SetCommand(None, None)
  case Array(key) => // "set key"
    SetCommand(Some(key), None)
  case Array(key, value) => // "set key=value"
    SetCommand(Some(key), Some(value))
}
```

Also, you may want to handle the case where a space precedes the "set", not sure if that's possible. (I'm sure there's also some extraordinarily beautiful solution that integrates with the Scala parsers, blinding all who dare to look upon it.)