Changeset View
Changeset View
Standalone View
Standalone View
src/parser/argument/PhutilArgumentParser.php
Context not available. | |||||
continue; | continue; | ||||
} else if (!strncmp('--', $arg, 2)) { | } else if (!strncmp('--', $arg, 2)) { | ||||
$pre = '--'; | $pre = '--'; | ||||
$arg = substr($arg, 2); | $arg = @substr($arg, 2); | ||||
$map = $specs_by_name; | $map = $specs_by_name; | ||||
$options = array_keys($specs_by_name); | $options = array_keys($specs_by_name); | ||||
} else if (!strncmp('-', $arg, 1) && strlen($arg) > 1) { | } else if (!strncmp('-', $arg, 1) && @strlen($arg) > 1) { | ||||
$pre = '-'; | $pre = '-'; | ||||
$arg = substr($arg, 1); | $arg = @substr($arg, 1); | ||||
$map = $specs_by_short; | $map = $specs_by_short; | ||||
} else { | } else { | ||||
$is_initial = false; | $is_initial = false; | ||||
Context not available. | |||||
if ($map) { | if ($map) { | ||||
$val = null; | $val = null; | ||||
$parts = explode('=', $arg, 2); | $parts = @explode('=', $arg, 2); | ||||
if (count($parts) == 2) { | if (count($parts) == 2) { | ||||
list($arg, $val) = $parts; | list($arg, $val) = $parts; | ||||
} | } | ||||
Context not available. | |||||
foreach ($conflicts as $conflict => $reason) { | foreach ($conflicts as $conflict => $reason) { | ||||
if (array_key_exists($conflict, $this->results)) { | if (array_key_exists($conflict, $this->results)) { | ||||
if (!is_string($reason) || !strlen($reason)) { | if (!is_string($reason) || !@strlen($reason)) { | ||||
$reason = '.'; | $reason = '.'; | ||||
} else { | } else { | ||||
$reason = ': '.$reason.'.'; | $reason = ': '.$reason.'.'; | ||||
Context not available. | |||||
$workflows = $this->workflows; | $workflows = $this->workflows; | ||||
} | } | ||||
$workflow = idx($workflows, strtolower($workflow_name)); | $workflow = idx($workflows, @strtolower($workflow_name)); | ||||
if (!$workflow) { | if (!$workflow) { | ||||
$out[] = $this->indent( | $out[] = $this->indent( | ||||
$indent, | $indent, | ||||
Context not available. | |||||
} else if ( | } else if ( | ||||
is_string($value) && | is_string($value) && | ||||
!strncmp($value, '-', 1) && | !strncmp($value, '-', 1) && | ||||
strlen($value) > 1) { | @strlen($value) > 1) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0