Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14111480
D11138.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
991 B
Referenced Files
None
Subscribers
None
D11138.diff
View Options
diff --git a/src/parser/argument/PhutilArgumentParser.php b/src/parser/argument/PhutilArgumentParser.php
--- a/src/parser/argument/PhutilArgumentParser.php
+++ b/src/parser/argument/PhutilArgumentParser.php
@@ -124,7 +124,9 @@
for ($ii = 0; $ii < $len; $ii++) {
$arg = $argv[$ii];
$map = null;
- if ($arg == '--') {
+ if (!is_string($arg)) {
+ // Non-string argument; pass it through as-is.
+ } else if ($arg == '--') {
// This indicates "end of flags".
break;
} else if ($arg == '-') {
@@ -660,7 +662,11 @@
if ($value == '--') {
unset($argv[$key]);
break;
- } else if (!strncmp($value, '-', 1) && strlen($value) > 1) {
+ } else if (
+ is_string($value) &&
+ !strncmp($value, '-', 1) &&
+ strlen($value) > 1) {
+
throw new PhutilArgumentUsageException(
"Argument '{$value}' is unrecognized. Use '--' to indicate the ".
"end of flags.");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 9:35 PM (22 h, 51 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6802380
Default Alt Text
D11138.diff (991 B)
Attached To
Mode
D11138: Treat non-string arguments as normal arguments in PhutilArgumentParser
Attached
Detach File
Event Timeline
Log In to Comment