]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Simplify `arc help`, add `arc help --full`
authorvrana <jakubv@fb.com>
Sun, 4 Mar 2012 11:16:45 +0000 (03:16 -0800)
committervrana <jakubv@fb.com>
Mon, 5 Mar 2012 18:44:17 +0000 (10:44 -0800)
Summary:
`arc help` currently prints more than 500 lines and it is hardly usable without ##> arc.help##, ##| less##, ##| grep##, ##| wc -l## or such.
It is even worse with custom commands and options.

This diff changes `arc help` to only list commands with no description (under 100 lines).
It also adds `arc help --full` which maintains the original behavior.
It doesn't change `arc help <command>`.

NOTE: BC break on different levels.

Test Plan:
  arc help
  arc help --full
  arc help help
  arc help lint

Reviewers: epriestley

Reviewed By: epriestley

CC: nh, aran, epriestley
Differential Revision: https://secure.phabricator.com/D1769

src/workflow/help/ArcanistHelpWorkflow.php

index 2c0273a7a408e793ddb80eff42cfbbc954aadef1..2b0cf99c185e9208c031e0b7a6a189771adedd12 100644 (file)
@@ -160,16 +160,13 @@ EOTEXT
     }
 
     $self = 'arc';
-    $description = ($this->getArgument('full') ?
-      "This help file provides a detailed command reference." :
-      "Run 'arc help --full' to get detailed command reference.");
     echo phutil_console_format(<<<EOTEXT
 **NAME**
       **{$self}** - arcanist, a code review and revision management utility
 
 **SYNOPSIS**
       **{$self}** __command__ [__options__] [__args__]
-      {$description}
+      This help file provides a detailed command reference.
 
 **COMMAND REFERENCE**
 
@@ -180,6 +177,7 @@ EOTEXT
     );
 
     if (!$this->getArgument('full')) {
+      echo "Run 'arc help --full' to get commands and options descriptions.\n";
       return;
     }