Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14092514
D21338.id50797.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
860 B
Referenced Files
None
Subscribers
None
D21338.id50797.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21338: Allow "arc" to accept any prefix of a command as that command
Attached
Detach File
Event Timeline
Log In to Comment