-f ' . PHP_EOL; exit(1); } $options = getopt(Short::asString(), Long::asArray()); if (!$options) { echo 'Error getting arguments' . PHP_EOL; exit(1); } try { $cliOption = CliOption::fromArray($options); } catch (RuntimeException $e) { echo $e->getMessage(); exit(1); } try { $csvCalculationService = new CsvCalculationService( new CsvReader(__DIR__ . '/test.csv'), new CsvWriter(__DIR__ . '/result.csv'), MathOperationFactory::getOperationFromCliOption($cliOption), new FileLogger(), ); $csvCalculationService->execute(); } catch (Exception $e) { echo $e->getMessage(); }