Page MenuHomePhabricator

Treat non-string arguments as normal arguments in PhutilArgumentParser
ClosedPublic

Authored by hach-que on Jan 2 2015, 1:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 28, 10:26 AM
Unknown Object (File)
Wed, Nov 27, 9:35 PM
Unknown Object (File)
Wed, Nov 20, 10:22 AM
Unknown Object (File)
Oct 29 2024, 2:12 PM
Unknown Object (File)
Oct 23 2024, 10:12 PM
Unknown Object (File)
Oct 22 2024, 3:35 AM
Unknown Object (File)
Sep 16 2024, 7:58 AM
Unknown Object (File)
Aug 19 2024, 5:43 AM
Subscribers

Details

Summary

This treats non-string arguments as "normal" arguments in PhutilArgumentParser (basically it prevents it from trying to detect - or -- prefixes).

In Omni, I use the PhutilArgumentParser to parse arguments, but Omni supports passing structured data (arrays, objects and other things with types) as arguments to builtins and Omni scripts.

Test Plan

Didn't see errors due to strncmp, etc. when passing arrays to builtins.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

hach-que retitled this revision from to Treat non-string arguments as normal arguments in PhutilArgumentParser.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.
epriestley edited edge metadata.

This is a little off-label but seems reasonable enough.

This revision is now accepted and ready to land.Jan 2 2015, 6:35 PM
This revision was automatically updated to reflect the committed changes.