Page MenuHomePhabricator

D21338.id50797.diff
No OneTemporary

D21338.id50797.diff

diff --git a/src/parser/argument/PhutilArgumentSpellingCorrector.php b/src/parser/argument/PhutilArgumentSpellingCorrector.php
--- a/src/parser/argument/PhutilArgumentSpellingCorrector.php
+++ b/src/parser/argument/PhutilArgumentSpellingCorrector.php
@@ -115,6 +115,21 @@
$options[$key] = $this->normalizeString($option);
}
+ // In command mode, accept any unique prefix of a command as a shorthand
+ // for that command.
+ if ($this->getMode() === self::MODE_COMMANDS) {
+ $prefixes = array();
+ foreach ($options as $option) {
+ if (!strncmp($input, $option, strlen($input))) {
+ $prefixes[] = $option;
+ }
+ }
+
+ if (count($prefixes) === 1) {
+ return $prefixes;
+ }
+ }
+
$distances = array();
$inputv = phutil_utf8v($input);
foreach ($options as $option) {

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 6:31 AM (12 h, 1 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6788406
Default Alt Text
D21338.id50797.diff (860 B)

Event Timeline