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.)