setName('libresign:uninstall')
->setDescription('Uninstall files')
->addOption(
name: 'all',
shortcut: null,
mode: InputOption::VALUE_NONE,
description: 'All binaries'
)
->addOption(
name: 'jsignpdf',
shortcut: null,
mode: InputOption::VALUE_NONE,
description: 'JSignPdf'
)
->addOption(
name: 'pdftk',
shortcut: null,
mode: InputOption::VALUE_NONE,
description: 'PDFtk'
)
->addOption(
name: 'cfssl',
shortcut: null,
mode: InputOption::VALUE_NONE,
description: 'CFSSL'
)
->addOption(
name: 'java',
shortcut: null,
mode: InputOption::VALUE_NONE,
description: 'Java'
);
}
protected function execute(InputInterface $input, OutputInterface $output): int {
$ok = false;
try {
$all = $input->getOption('all');
if ($input->getOption('java') || $all) {
$this->installService->uninstallJava();
$ok = true;
}
if ($input->getOption('jsignpdf') || $all) {
$this->installService->uninstallJSignPdf();
$ok = true;
}
if ($input->getOption('pdftk') || $all) {
$this->installService->uninstallPdftk();
$ok = true;
}
if ($input->getOption('cfssl') || $all) {
$this->installService->uninstallCfssl();
$ok = true;
}
} catch (\Exception $e) {
$this->logger->error($e->getMessage());
throw $e;
}
if (!$ok) {
$output->writeln('Please inform what you want to install');
$output->writeln('--all to all');
$output->writeln('--help to check the available options');
return 1;
}
return 0;
}
}