Prints the given resources.

@param IO       $io      The I/O.
@param string[] $matches An array of short resource class names indexed
by the resource path.
190223
private function printTable(IO $io, array $matches)
    {
        $table = new Table(TableStyle::borderless());

        foreach ($matches as $path => $shortClass) {
            $table->addRow(array($shortClass, sprintf('<c1>%s</c1>', $path)));
        }

        $table->render($io);
    }
476742
public static void printHelp(PrintStream stream) throws IOException {
            stream.println();
            stream.println("NAME");
            stream.println("  meta sync-version - Synchronize metadata versions across all nodes");
            stream.println();
            stream.println("SYNOPSIS");
            stream.println("  meta sync-version -u <url> [--confirm]");
            stream.println();
            getParser().printHelpOn(stream);
            stream.println();
        }
1374190
private function printModulesWithFormat(IO $io, ModuleList $modules, $format)
    {
        /** @var Module $module */
        foreach ($modules as $module) {
            $installInfo = $module->getInstallInfo();

            $io->writeLine(strtr($format, array(
                '%name%' => $module->getName(),
                '%installer%' => $installInfo ? $installInfo->getInstallerName() : '',
                '%install_path%' => $module->getInstallPath(),
                '%state%' => self::$stateStrings[$module->getState()],
                '%env%' => $installInfo ? $installInfo->getEnvironment() : Environment::PROD,
            )));
        }
    }
1115133
public function render(IO $io, $indentation = 0)
    {
        // Is the table empty?
        if (!$this->rows) {
            return;
        }

        $screenWidth = $io->getTerminalDimensions()->getWidth();
        $excessColumnWidth = max(
            StringUtil::getLength(sprintf($this->style->getHeaderCellFormat(), ''), $io),
            StringUtil::getLength(sprintf($this->style->getCellFormat(), ''), $io)
        );

        $wrapper = $this->getCellWrapper($io, $screenWidth, $excessColumnWidth, $indentation);

        $this->renderRows($io, $wrapper->getWrappedRows(), $wrapper->getColumnLengths(), $excessColumnWidth, $indentation);
    }
997720
private static function write(IOInterface $io, string $message)
    {
        $msg = [
            '[Panthor]: ' . $message,
        ];

        $io->write($msg);
    }
696285
public void println(String s) throws IOException
  {
    if(s!=null) {
        this.output.write(s.getBytes(), 0, s.length());
    }
    this.output.write(CRLF, 0, 2);
  }
685546
public function run(RawArgs $args, IO $io)
    {
        return $this->handle($this->parseArgs($args), $io);
    }
603823
public function process(IOInterface $io, array $libraries, $methodKey = null)
    {
        // No-op
        if (empty($libraries)) {
            return;
        }

        // Setup root folder
        $this->setupResources($io);

        // Get or choose method
        if (!$methodKey) {
            $methodKey = $this->getMethodKey();
        }
        $method = $this->getMethod($methodKey);

        // Update all modules
        foreach ($libraries as $module) {
            // Skip this module if no exposure required
            if (!$module->requiresExpose()) {
                continue;
            }
            $name = $module->getName();
            $type = $module->getType();
            $io->write(
                "Exposing web directories for {$type} <info>{$name}</info> with method <info>{$methodKey}</info>:"
            );
            foreach ($module->getExposedFolders() as $folder) {
                $io->write("  - <info>$folder</info>");
            }

            // Expose web dirs with given method
            $module->exposePaths($method);
        }

        // On success, write `.method` token to persist for subsequent updates
        $this->saveMethodKey($methodKey);
    }
1033468
public void print(String[][] values) throws IOException {
    if (values == null || values.length == 0) {
      csvPrinter.println();
    } else {
      for (String[] value : values) {
        csvPrinter.printRecords((Object) value);
      }
    }
    csvPrinter.flush();
  }
124647
public void print(Writer out) throws IOException{
		if (tag == null)
			System.out.println(tag);			
		out.write(token + "\t" + tag + "\n");		
	}
671913
public function render(IO $io, $indentation = 0)
    {
        if ($this->config->getDisplayName() && $this->config->getVersion()) {
            $paragraph = new Paragraph("{$this->config->getDisplayName()} version <c1>{$this->config->getVersion()}</c1>");
        } elseif ($this->config->getDisplayName()) {
            $paragraph = new Paragraph("{$this->config->getDisplayName()}");
        } else {
            $paragraph = new Paragraph('Console Tool');
        }

        $paragraph->render($io, $indentation);
    }
1184949
public static void printHelp(PrintStream stream) throws IOException {
            stream.println();
            stream.println("NAME");
            stream.println("  meta check - Check if metadata is consistent across all nodes");
            stream.println();
            stream.println("SYNOPSIS");
            stream.println("  meta check (<meta-key-list> | all) -u <url>");
            stream.println();
            stream.println("COMMENTS");
            stream.println("  Valid meta keys are:");
            stream.println("    " + MetadataStore.CLUSTER_KEY);
            stream.println("    " + MetadataStore.STORES_KEY);
            stream.println("    " + MetadataStore.SERVER_STATE_KEY);
            stream.println();
            getParser().printHelpOn(stream);
            stream.println();
        }
1325849
public function render(IO $io, $indentation = 0)
    {
        $linePrefix = str_repeat(' ', $indentation);
        $visibleLabel = $io->removeFormat($this->label);
        $styleTagLength = strlen($this->label) - strlen($visibleLabel);

        $textOffset = $this->aligned && $this->alignment ? $this->alignment->getTextOffset() - $indentation : 0;
        $textOffset = max($textOffset, strlen($visibleLabel) + $this->padding);
        $textPrefix = str_repeat(' ', $textOffset);

        // 1 trailing space
        $textWidth = $io->getTerminalDimensions()->getWidth() - 1 - $textOffset - $indentation;
        // TODO replace wordwrap() by implementation that is aware of format codes
        $text = str_replace("\n", "\n".$linePrefix.$textPrefix, wordwrap($this->text, $textWidth));

        // Add the total length of the style tags ("<b>", ...)
        $labelWidth = $textOffset + $styleTagLength;

        $io->write(rtrim(sprintf(
            "%s%-${labelWidth}s%s",
            $linePrefix,
            $this->label,
            rtrim($text)
        ))."\n");
    }
181788
private function findCommand($i, array $matches)
    {
        $match = $matches[0][$i];
        $cmd = isset($matches['function'][$i]) ? $matches['function'][$i] : '';

        return [$match, $cmd];
    }
1027052
private function findString($i, array $matches)
    {
        $string = isset($matches[0][$i]) ? $matches[0][$i] : '';


        return substr($string, 1, -1);
    }
227105
protected function startingMessage(ConsoleIO $io, $theme)
    {
        $io->newLine();
        $io->write(sprintf('<comment>Generating a site using the theme: "%s"...</comment>', $theme));
    }
1241552
public void render(@NonNull Resource output) throws IOException {
      render(output, GraphViz.Format.PNG);
   }