示例#1
0
 function get_longdesc()
 {
     $binding = array();
     foreach (Terminus::get_configurator()->get_spec() 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 ((bool) Terminus::get_config('json')) {
         return $binding;
     }
     return Utils\mustache_render('man-params.mustache', $binding);
 }
示例#2
0
文件: help.php 项目: newtoid/cli
 private static function get_initial_markdown($command)
 {
     $name = implode(' ', Dispatcher\get_path($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 ((bool) Terminus::get_config('json')) {
         $rendered_help = $binding;
     } else {
         $rendered_help = Utils\mustache_render('man.mustache', $binding);
     }
     return $rendered_help;
 }