Home GnuPG

Move command spelling correction to libphutil
d0daa2b343e4Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Move command spelling correction to libphutil

Summary:
Ref T7489. Currently, arc has helpful flag/argument spelling correction but libphutil does not.

The implementation in arc is also pretty hard-coded, and exposed as static methods on ArcanistConfiguration. This class isn't closely related to argument parsing, and I would like to remove it anyway (see T10329).

This copies the bulk of the implementation to libphutil and separates it out so it isn't bolted onto some other class.

(arc may still need to do some of this on its own, since it has additional rules like aliases that I don't necessarily expect to generalize, but should be able to share this code.)

Test Plan:

$ ./bin/repository reparce --messages
(Assuming "reparce" is the British spelling of "reparse".)
(Assuming "--messages" is the British spelling of "message".)
Usage Exception: Specify a commit or repository to reparse.
$ ./bin/repository heaw
Usage Exception: Invalid command "heaw". Did you mean:
      help
      thaw

For details on available commands, run `repository help`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7489

Differential Revision: https://secure.phabricator.com/D16332

Details

Provenance
epriestley <git@epriestley.com>Authored on Jul 26 2016, 10:19 PM
Parents
rPHUTILff84abc7d857: If "utf8mb4" is unavailable on the client, fall back to "binary"
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTILd0daa2b343e4: Move command spelling correction to libphutil (authored by epriestley <git@epriestley.com>).Jul 27 2016, 6:35 PM