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)
Fri, Apr 19, 1:47 PM
Unknown Object (File)
Fri, Apr 19, 1:47 PM
Unknown Object (File)
Fri, Apr 19, 1:33 PM
Unknown Object (File)
Fri, Apr 19, 12:54 PM
Unknown Object (File)
Wed, Apr 17, 2:48 PM
Unknown Object (File)
Mon, Apr 15, 9:42 AM
Unknown Object (File)
Thu, Apr 11, 2:27 AM
Unknown Object (File)
Thu, Apr 11, 2:27 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.