コード例 #1
0
ファイル: RootCommand.php プロジェクト: nataliejeremy/cli
 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;
 }