DescriptionAdd spell-checking to `gn help`.
I tried porting a gyp copies step to gn, and one of the things I tried while
doing so whas `gn help copies`. If help had spell-checking, it would've
suggested `gn help copy`. Since that seems like a nice change, add this.
Also stop printing full help output when a topic is not found, because then
the "not found" error scrolls by so fast that I never see it.
Demo:
$ out/gn/gn help copyasdfasdf
ERROR No help on "copyasdfasdf".
Run `gn help` for a list of available topics.
$ out/gn/gn help copies
ERROR No help on "copies".
Did you mean `gn help copy`?
(There's another implementation of EditDistance() in
components/ssl/error_classification.cc -- but that works based on strings
not StringPieces and it doesn't have a "max_distance" parameter.
Since there's only one other instance of this function, just having a second version
of it seems preferrable over finding some place to put this function so it can be used
from both places. I'm however improving the other copy a bit in
https://codereview.chromium.org/1690593002/)
BUG=none
Committed: https://crrev.com/11afb324fa322a3d651124f3ca244c9595f84768
Cr-Commit-Position: refs/heads/master@{#375673}
Patch Set 1 #Patch Set 2 : windows warnings #Patch Set 3 : actually #Patch Set 4 : #$^&*&^$ #
Total comments: 1
Patch Set 5 : rebase #Patch Set 6 : move to string_utils, add tests #
Total comments: 2
Messages
Total messages: 18 (8 generated)
|