setName('backup:target:backends') ->setDescription('List the storage backends (from files_external) that can be used as backup location'); } protected function execute(InputInterface $input, OutputInterface $output): int { $backends = $this->targets->availableBackends(); if ($input->getOption('output') !== self::OUTPUT_FORMAT_PLAIN) { $this->writeMixedInOutputFormat($input, $output, $backends); return 0; } foreach ($backends as $b) { $output->writeln(sprintf('%s (%s)', $b['id'], $b['name'])); foreach ($b['parameters'] as $key => $p) { $output->writeln(sprintf(' -o %s=... %s', $key, is_array($p) ? ($p['value'] ?? '') : '')); } foreach ($b['auth'] as $a) { $output->writeln(sprintf(' -a %s (%s)', $a['id'], $a['name'])); foreach ($a['parameters'] as $key => $p) { $output->writeln(sprintf(' -o %s=... %s', $key, is_array($p) ? ($p['value'] ?? '') : '')); } } } return 0; } }