Changeset View
Changeset View
Standalone View
Standalone View
support/ArcanistRuntime.php
Show All 26 Lines | public function execute(array $argv) { | ||||
$this->logEngine = $log; | $this->logEngine = $log; | ||||
try { | try { | ||||
return $this->executeCore($argv); | return $this->executeCore($argv); | ||||
} catch (ArcanistConduitException $ex) { | } catch (ArcanistConduitException $ex) { | ||||
$log->writeError(pht('CONDUIT'), $ex->getMessage()); | $log->writeError(pht('CONDUIT'), $ex->getMessage()); | ||||
} catch (PhutilArgumentUsageException $ex) { | } catch (PhutilArgumentUsageException $ex) { | ||||
$log->writeError(pht('USAGE EXCEPTION'), $ex->getMessage()); | $log->writeError(pht('USAGE EXCEPTION'), $ex->getMessage()); | ||||
} catch (ArcanistUserAbortException $ex) { | |||||
$log->writeError(pht('---'), $ex->getMessage()); | |||||
} | } | ||||
return 1; | return 1; | ||||
} | } | ||||
private function executeCore(array $argv) { | private function executeCore(array $argv) { | ||||
$log = $this->getLogEngine(); | $log = $this->getLogEngine(); | ||||
▲ Show 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | if (!$should_exit) { | ||||
// If no workflow in the current execution stack can handle an interrupt | // If no workflow in the current execution stack can handle an interrupt | ||||
// signal, just exit on the first interrupt. | // signal, just exit on the first interrupt. | ||||
if (!$handler) { | if (!$handler) { | ||||
$should_exit = true; | $should_exit = true; | ||||
} | } | ||||
} | } | ||||
// It's common for users to ^C on prompts. Write a newline before writing | |||||
// a response to the interrupt so the behavior is a little cleaner. This | |||||
// also avoids lines that read "^C [ INTERRUPT ] ...". | |||||
$log->writeNewline(); | |||||
if ($should_exit) { | if ($should_exit) { | ||||
$log->writeHint( | $log->writeHint( | ||||
pht('INTERRUPT'), | pht('INTERRUPT'), | ||||
pht('Interrupted by SIGINT (^C).')); | pht('Interrupted by SIGINT (^C).')); | ||||
exit(128 + $signo); | exit(128 + $signo); | ||||
} | } | ||||
$log->writeHint( | $log->writeHint( | ||||
Show All 25 Lines |