/** * Retrieves the synopsis of a given command or subcommand * * @param [mixed] $command The command or subcommand to get documentation on * @return [string] $rendered_help */ private function getInitialMarkdown($command) { $name = implode(' ', Dispatcher\getPath($command)); $binding = array('name' => $name, 'shortdesc' => $command->getShortdesc()); $binding['synopsis'] = wordwrap($name . ' ' . $command->getSynopsis(), 79); if ($command->canHaveSubcommands()) { $binding['has-subcommands']['subcommands'] = $this->renderSubcommands($command); } if (Terminus::getConfig('format') == 'json') { $rendered_help = $binding; } else { $rendered_help = Utils\mustacheRender('man.mustache', $binding); } return $rendered_help; }
function get_longdesc() { $binding = array(); foreach (Terminus::getConfigurator()->getSpec() as $key => $details) { if ($details['runtime'] === false || isset($details['deprecated']) || isset($details['hidden'])) { continue; } if ($details['runtime']) { $synopsis = "--[no-]{$key}"; } else { $synopsis = "--{$key}" . $details['runtime']; } $binding['parameters'][] = array('synopsis' => $synopsis, 'desc' => $details['desc']); } if (Terminus::getConfig('format') == 'json') { return $binding; } return Utils\mustacheRender('man-params.mustache', $binding); }
private static function get_initial_markdown($command) { $name = implode(' ', Dispatcher\getPath($command)); $binding = array('name' => $name, 'shortdesc' => $command->get_shortdesc()); $binding['synopsis'] = wordwrap("{$name} " . $command->get_synopsis(), 79); if ($command->can_have_subcommands()) { $binding['has-subcommands']['subcommands'] = self::render_subcommands($command); } if (Terminus::getConfig('format') == 'json') { $rendered_help = $binding; } else { $rendered_help = Utils\mustacheRender('man.mustache', $binding); } return $rendered_help; }