setName('backup:trash:restore') ->setDescription('Bring a removed snapshot back from the trash') ->addArgument('target', InputArgument::REQUIRED, 'Location name or id') ->addArgument('snapshot', InputArgument::REQUIRED, 'Snapshot id (see backup:trash)'); } protected function execute(InputInterface $input, OutputInterface $output): int { try { $this->prune->untrash($this->targets->get($input->getArgument('target')), $input->getArgument('snapshot')); } catch (\Throwable $e) { $output->writeln('' . $e->getMessage() . ''); return 1; } $output->writeln('Snapshot restored from the trash.'); return 0; } }