#!/usr/bin/env php
setCatchExceptions(false);
$application->addCommands([
new InitCommand(),
new PushCommand(),
new PullCommand(),
new StatusCommand(),
]);
$output = new ConsoleOutput();
try {
exit($application->run(null, $output));
} catch (CliException $exception) {
// Erreur attendue : le message a été rédigé pour être lu. Pas de trace —
// une pile d'appels devant « exportez TQS_API_KEY » n'aide personne.
$output->getErrorOutput()->writeln(['', ' Erreur ', '', $exception->getMessage(), '']);
exit(1);
} catch (Throwable $exception) {
$errors = $output->getErrorOutput();
$errors->writeln(['', ' Erreur inattendue ', '', $exception->getMessage(), '']);
if ($errors->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
$errors->writeln($exception->getTraceAsString());
} else {
$errors->writeln('Relancez avec -v pour la trace complète.');
$errors->writeln('');
}
exit(1);
}