Skip to content

Commit

Permalink
Merge pull request #61 from ChlodAlejandro/master
Browse files Browse the repository at this point in the history
SshCommand: QoL improvements
  • Loading branch information
samwilson committed Jul 25, 2023
2 parents 19b03c4 + cced6f1 commit 6512035
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Command/SshCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$slices = array_unique(array_values($this->client->getDbList()));
$processArgs = ['ssh', '-N'];

if ($output->isVerbose()) {
$processArgs[] = '-v';
} elseif ($output->isVeryVerbose()) {
$processArgs[] = '-vv';
} elseif ($output->isDebug()) {
$processArgs[] = '-vvv';
}

foreach ($slices as $slice) {
$processArgs[] = '-L';
$arg = $this->client->getPortForSlice($slice).":$slice.$host:3306";
Expand All @@ -110,7 +119,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if ($toolsDb) {
$processArgs[] = '-L';
$port = $this->client->getPortForSlice('toolsdb');
$processArgs[] = $port.':tools'.self::HOST_SUFFIX.':3306';
$arg = $port.':tools'.self::HOST_SUFFIX.':3306';
if ($bindAddress) {
$arg = $bindAddress.':'.$arg;
}
$processArgs[] = $arg;
}
$processArgs[] = $login;

Expand Down

0 comments on commit 6512035

Please sign in to comment.