Added flag to inverse servers-filter logic.
This commit is contained in:
@@ -24,13 +24,8 @@ final class ViewCommand extends Command
|
||||
{
|
||||
$this->setName('servers:view')
|
||||
->setDescription('View Servers settings.')
|
||||
->addOption(
|
||||
'servers-filter',
|
||||
's',
|
||||
InputOption::VALUE_OPTIONAL,
|
||||
'View selected servers, comma seperated. \'s1,s2\'.',
|
||||
''
|
||||
)
|
||||
->addOption('servers-filter', 's', InputOption::VALUE_OPTIONAL, 'Select backends. Comma (,) seperated.', '')
|
||||
->addOption('exclude', null, InputOption::VALUE_NONE, 'Inverse --servers-filter logic.')
|
||||
->addOption('config', 'c', InputOption::VALUE_REQUIRED, 'Use Alternative config file.')
|
||||
->addArgument(
|
||||
'filter',
|
||||
@@ -61,13 +56,11 @@ final class ViewCommand extends Command
|
||||
$filter = $input->getArgument('filter');
|
||||
|
||||
foreach (Config::get('servers', []) as $serverName => $server) {
|
||||
if ($isCustom && !in_array($serverName, $selected, true)) {
|
||||
|
||||
if ($isCustom && $input->getOption('exclude') === in_array($serverName, $selected)) {
|
||||
$output->writeln(
|
||||
sprintf(
|
||||
'<comment>Ignoring \'%s\' as requested by [-s, --servers-filter] flag.</comment>',
|
||||
$serverName
|
||||
),
|
||||
OutputInterface::VERBOSITY_DEBUG
|
||||
sprintf('%s: Ignoring backend as requested by [-s, --servers-filter].', $serverName),
|
||||
OutputInterface::VERBOSITY_VERY_VERBOSE
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ class ExportCommand extends Command
|
||||
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Do not commit any changes.')
|
||||
->addOption('timeout', null, InputOption::VALUE_REQUIRED, 'Set request timeout in seconds.')
|
||||
->addOption('servers-filter', 's', InputOption::VALUE_OPTIONAL, 'Select backends. Comma (,) seperated.', '')
|
||||
->addOption('exclude', null, InputOption::VALUE_NONE, 'Inverse --servers-filter logic.')
|
||||
->addOption('ignore-date', 'i', InputOption::VALUE_NONE, 'Ignore date comparison.')
|
||||
->addOption('trace', null, InputOption::VALUE_NONE, 'Enable Debug Tracing mode.')
|
||||
->addOption(
|
||||
@@ -93,7 +94,7 @@ class ExportCommand extends Command
|
||||
foreach (Config::get('servers', []) as $name => $backend) {
|
||||
$type = strtolower(ag($backend, 'type', 'unknown'));
|
||||
|
||||
if ($isCustom && false === in_array($name, $selected)) {
|
||||
if ($isCustom && $input->getOption('exclude') === in_array($name, $selected)) {
|
||||
$this->logger->info(
|
||||
sprintf('%s: Ignoring backend as requested by [-s, --servers-filter].', $name)
|
||||
);
|
||||
|
||||
@@ -45,6 +45,7 @@ class ImportCommand extends Command
|
||||
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Do not commit any changes.')
|
||||
->addOption('timeout', null, InputOption::VALUE_REQUIRED, 'Set request timeout in seconds.')
|
||||
->addOption('servers-filter', 's', InputOption::VALUE_OPTIONAL, 'Select backends. Comma (,) seperated.', '')
|
||||
->addOption('exclude', null, InputOption::VALUE_NONE, 'Inverse --servers-filter logic.')
|
||||
->addOption('trace', null, InputOption::VALUE_NONE, 'Enable Debug Tracing mode.')
|
||||
->addOption(
|
||||
'always-update-metadata',
|
||||
@@ -103,7 +104,7 @@ class ImportCommand extends Command
|
||||
foreach (Config::get('servers', []) as $serverName => $server) {
|
||||
$type = strtolower(ag($server, 'type', 'unknown'));
|
||||
|
||||
if ($isCustom && !in_array($serverName, $selected, true)) {
|
||||
if ($isCustom && $input->getOption('exclude') === in_array($serverName, $selected)) {
|
||||
$this->logger->info(
|
||||
sprintf('%s: Ignoring backend as requested by [-s, --servers-filter].', $serverName)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user