Page MenuHomePhabricator

Add an ArgumentParser helper for integers
ClosedPublic

Authored by epriestley on May 3 2022, 9:09 PM.
Tags
None
Referenced Files
F14087115: D21799.diff
Sat, Nov 23, 7:16 PM
Unknown Object (File)
Thu, Nov 21, 12:57 PM
Unknown Object (File)
Mon, Nov 11, 12:26 AM
Unknown Object (File)
Oct 24 2024, 7:05 AM
Unknown Object (File)
Oct 16 2024, 7:36 PM
Unknown Object (File)
Oct 9 2024, 2:30 PM
Unknown Object (File)
Oct 8 2024, 7:27 PM
Unknown Object (File)
Oct 7 2024, 2:46 PM
Subscribers
None

Details

Summary

Ref T13676. With increased PHP8.1 strictness around null, it seems reasonable to add some convenience parsing to "PhutilArgumentParser".

Add a helper function for parsing integers.

Test Plan

See next change. Tried these arguments:

--count ''
--count asdf
--count 0
--count -3
--count 999999999999999999999999999999999999999999999234
--count 5

Got sensible parsing and appropriate feedback in all cases.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.May 3 2022, 10:57 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.