Page MenuHomePhabricator

Add "command" vs "flag" corrector modes and refuse to correct "--start" into "restart"
ClosedPublic

Authored by epriestley on Jan 16 2019, 8:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 6:57 PM
Unknown Object (File)
Wed, May 1, 12:26 AM
Unknown Object (File)
Feb 8 2024, 5:19 AM
Unknown Object (File)
Jan 30 2024, 8:17 AM
Unknown Object (File)
Jan 3 2024, 5:12 AM
Unknown Object (File)
Jan 3 2024, 1:35 AM
Unknown Object (File)
Jan 1 2024, 1:43 PM
Unknown Object (File)
Dec 27 2023, 1:01 PM
Subscribers
None

Details

Summary

Currently, we correct "bin/aphlict --start" into "bin/aphlict restart". When a command starts with "-", don't correct it since it's more far more likely a mistake (intended to be a flag or just not correct usage) than a typo.

Test Plan

Ran "bin/aphlict --start", "bin/aphlict restart", "bin/aphlict restatr".

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jan 16 2019, 8:17 PM

I think a simpler implementation of this would just be "don't correct any input beginning with -" since even flags are passed to us with the leading - stripped, but all the changes are internal to the class anyway and I think this interacts with changes in the wilds branch of Arcanist so it will probably need to be touched more heavily once that moves forward again anyway.

This revision was automatically updated to reflect the committed changes.