diff --git a/scripts/daemon/exec/exec_daemon.php b/scripts/daemon/exec/exec_daemon.php --- a/scripts/daemon/exec/exec_daemon.php +++ b/scripts/daemon/exec/exec_daemon.php @@ -14,7 +14,7 @@ $args->setTagline('daemon executor'); $args->setSynopsis(<<parse( @@ -28,29 +28,30 @@ 'help' => 'Enable debug memory tracing.', ), array( - 'name' => 'log', + 'name' => 'log', 'param' => 'file', 'help' => 'Send output to __file__.', ), array( - 'name' => 'load-phutil-library', - 'param' => 'library', - 'repeat' => true, + 'name' => 'load-phutil-library', + 'param' => 'library', + 'default' => array(), + 'repeat' => true, 'help' => 'Load __library__.', ), array( - 'name' => 'verbose', + 'name' => 'verbose', 'help' => 'Enable verbose activity logging.', ), array( - 'name' => 'more', + 'name' => 'argv', 'wildcard' => true, ), )); $trace_memory = $args->getArg('trace-memory'); -$trace_mode = $args->getArg('trace') || $trace_memory; -$verbose = $args->getArg('verbose'); +$trace_mode = $args->getArg('trace') || $trace_memory; +$verbose = $args->getArg('verbose'); $log = $args->getArg('log'); if ($log) { @@ -61,13 +62,11 @@ } $load = $args->getArg('load-phutil-library'); -$argv = $args->getArg('more'); +$argv = $args->getArg('argv'); -if ($load) { - foreach ($load as $library) { - $library = Filesystem::resolvePath($library); - phutil_load_library($library); - } +foreach ($load as $library) { + $library = Filesystem::resolvePath($library); + phutil_load_library($library); } PhutilErrorHandler::initialize(); @@ -84,9 +83,9 @@ } if ($echo_to_stderr) { - // If the caller has used "--log" to redirect the error log to a file, PHP - // won't output it to stderr so the overseer can't capture it and won't - // be able to send it to the web console. Install a listener which just echoes + // If the caller has used `--log` to redirect the error log to a file, PHP + // won't output it to stderr so the overseer can't capture it and won't be + // able to send it to the web console. Install a listener which just echoes // errors to stderr, so we always get all the messages in the log and over // stdio, so they'll show up in the web console. PhutilErrorHandler::setErrorListener('phutil_daemon_error_listener');