mirror of https://github.com/sbt/sbt.git
don't suggest similar keys for strings with only 1 or 2 characters
This commit is contained in:
parent
426acdf3f9
commit
34a39740c7
|
|
@ -129,7 +129,7 @@ object Command
|
|||
"Not a valid " + label + ": " + value + similar(value, allowed)
|
||||
def similar(value: String, allowed: Iterable[String]): String =
|
||||
{
|
||||
val suggested = suggestions(value, allowed.toSeq)
|
||||
val suggested = if(value.length > 2) suggestions(value, allowed.toSeq) else Nil
|
||||
if(suggested.isEmpty) "" else suggested.mkString(" (similar: ", ", ", ")")
|
||||
}
|
||||
def suggestions(a: String, bs: Seq[String], maxDistance: Int = 3, maxSuggestions: Int = 3): Seq[String] =
|
||||
|
|
|
|||
Loading…
Reference in New Issue