]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve arc compatibility on Windows
authorepriestley <git@epriestley.com>
Mon, 5 Mar 2012 18:02:37 +0000 (10:02 -0800)
committerepriestley <git@epriestley.com>
Mon, 5 Mar 2012 18:02:37 +0000 (10:02 -0800)
Summary:
  - When altering the include_path(), use PATH_SEPARATOR (";" on Windows, ":" elsewhere) instead of hard-coded ":".
  - Detect missing php_curl.dll extension.
  - Use APPDATA instead of HOME for storing .arcrc (the internet implies this is correct?)
  - Don't try to do chmod() stuff on Windows; it's not critical and I don't want to figure out how it works.

Test Plan: Was able to run part of some arc commands on Windows.

Reviewers: btrahan, Makinde, Koolvin

Reviewed By: btrahan

CC: aran, epriestley
Maniphest Tasks: T124

Differential Revision: https://secure.phabricator.com/D1756

29 files changed:
scripts/__init_script__.php
scripts/arcanist.php
scripts/phutil_analyzer.php
src/workflow/alias/ArcanistAliasWorkflow.php
src/workflow/amend/ArcanistAmendWorkflow.php
src/workflow/base/ArcanistBaseWorkflow.php
src/workflow/branch/ArcanistBranchWorkflow.php
src/workflow/call-conduit/ArcanistCallConduitWorkflow.php
src/workflow/commit/ArcanistCommitWorkflow.php
src/workflow/cover/ArcanistCoverWorkflow.php
src/workflow/diff/ArcanistDiffWorkflow.php
src/workflow/download/ArcanistDownloadWorkflow.php
src/workflow/export/ArcanistExportWorkflow.php
src/workflow/git-hook-pre-receive/ArcanistGitHookPreReceiveWorkflow.php
src/workflow/help/ArcanistHelpWorkflow.php
src/workflow/install-certificate/ArcanistInstallCertificateWorkflow.php
src/workflow/land/ArcanistLandWorkflow.php
src/workflow/liberate/ArcanistLiberateWorkflow.php
src/workflow/lint/ArcanistLintWorkflow.php
src/workflow/list/ArcanistListWorkflow.php
src/workflow/mark-committed/ArcanistMarkCommittedWorkflow.php
src/workflow/merge/ArcanistMergeWorkflow.php
src/workflow/paste/ArcanistPasteWorkflow.php
src/workflow/patch/ArcanistPatchWorkflow.php
src/workflow/shell-complete/ArcanistShellCompleteWorkflow.php
src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php
src/workflow/unit/ArcanistUnitWorkflow.php
src/workflow/upload/ArcanistUploadWorkflow.php
src/workflow/which/ArcanistWhichWorkflow.php

index 9ff10fd4677f2b9934f5f3ad9d40a1635fd9a6ee..3d67b9fb84323c4ebd44159af54e81b007b891c1 100644 (file)
  */
 
 $include_path = ini_get('include_path');
-ini_set('include_path', $include_path.':'.dirname(__FILE__).'/../../');
+
+$parent_dir = dirname(dirname(dirname(__FILE__)));
+
+ini_set('include_path', $include_path.PATH_SEPARATOR.$parent_dir);
 @include_once 'libphutil/src/__phutil_library_init__.php';
 if (!@constant('__LIBPHUTIL__')) {
   echo "ERROR: Unable to load libphutil. Update your PHP 'include_path' to ".
@@ -25,7 +28,7 @@ if (!@constant('__LIBPHUTIL__')) {
   exit(1);
 }
 
-phutil_load_library(dirname(__FILE__).'/../src/');
+phutil_load_library(dirname(dirname(__FILE__)).'/src/');
 
 // There may be some kind of auto-prepend script configured which starts an
 // output buffer. Discard any such output buffers.
index 3808137e3df5e0b19b742db60d5e8f2e5d4e2a34..59d3665d59f04e38f68da3aeb69459bcb3a4a95a 100755 (executable)
@@ -331,15 +331,23 @@ function sanity_check_environment() {
       "'{$min_version}'.");
   }
 
-  $need_functions = array(
-    'json_decode' => '--without-json',
-  );
+  // NOTE: We don't have phutil_is_windows() yet here.
+
+  if (DIRECTORY_SEPARATOR != '/') {
+    $need_functions = array(
+      'curl_init'     => array('builtin-dll', 'php_curl.dll'),
+    );
+  } else {
+    $need_functions = array(
+      'json_decode'   => array('flag',        '--without-json'),
+    );
+  }
 
   $problems = array();
 
   $config = null;
   $show_config = false;
-  foreach ($need_functions as $fname => $flag) {
+  foreach ($need_functions as $fname => $resolution) {
     if (function_exists($fname)) {
       continue;
     }
@@ -355,15 +363,29 @@ function sanity_check_environment() {
       }
     }
 
-    if (strpos($config, $flag) !== false) {
+    $generic = true;
+    list($what, $which) = $resolution;
+
+    if ($what == 'flag' && strpos($config, $which) !== false) {
       $show_config = true;
+      $generic = false;
       $problems[] =
-        "This build of PHP was compiled with the configure flag '{$flag}', ".
+        "This build of PHP was compiled with the configure flag '{$which}', ".
         "which means it does not have the function '{$fname}()'. This ".
         "function is required for arc to run. Rebuild PHP without this flag. ".
         "You may also be able to build or install the relevant extension ".
         "separately.";
-    } else {
+    }
+
+    if ($what == 'builtin-dll') {
+      $generic = false;
+      $problems[] =
+        "Your install of PHP does not have the '{$which}' extension enabled. ".
+        "Edit your php.ini file and uncomment the line which reads ".
+        "'extension={$which}'.";
+    }
+
+    if ($generic) {
       $problems[] =
         "This build of PHP is missing the required function '{$fname}()'. ".
         "Rebuild PHP or install the extension which provides '{$fname}()'.";
index 5df271042615468cf100531eef33306a2785fc64..48c59a3268a00cec4fc64c2d51a7c42df10d0d33 100755 (executable)
@@ -34,7 +34,7 @@ $builtin = array(
       'print' => true,
       'exit'  => true,
       'die'   => true,
-      'phutil_load_library' => true,
+      'phutil_is_windows'   => true,
 
       // HPHP/i defines these functions as 'internal', but they are NOT
       // builtins and do not exist in vanilla PHP. Make sure we don't mark them
index 7a1704e5fd59333bfed56deb5916e5d07ba41556..70cbfda10714b0f5f555517bcbe9f150962ae6b4 100644 (file)
  */
 final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **alias**
       **alias** __command__
       **alias** __command__ __target__ -- [__options__]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: cli
           Create an alias from __command__ to __target__ (optionally, with
           __options__). For example:
@@ -46,7 +52,6 @@ final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow {
             arc alias fpatch
 
           Without any arguments, 'arc alias' will list aliases.
-
 EOTEXT
       );
   }
index fa0bc7c7ddbfd61541b847ff8b98eed9823c9747..b0e46092106c288b8b505c5edb00a507f7a6d76c 100644 (file)
  */
 final class ArcanistAmendWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **amend** [--revision __revision_id__] [--show]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git
           Amend the working copy after a revision has been accepted, so commits
           can be marked 'committed' and pushed upstream.
index 5e3dd820a36b9998093a0ae4bf54dca0f7c0f137..41bfa6d311f4d4cee2654d22ec0e80b19d4ca1b6 100644 (file)
@@ -374,6 +374,10 @@ abstract class ArcanistBaseWorkflow {
     return $this->arcanistConfiguration;
   }
 
+  public function getCommandSynopses() {
+    return get_class($this).": Undocumented";
+  }
+
   public function getCommandHelp() {
     return get_class($this).": Undocumented";
   }
@@ -921,25 +925,32 @@ abstract class ArcanistBaseWorkflow {
   }
 
   public static function getUserConfigurationFileLocation() {
-    return getenv('HOME').'/.arcrc';
+    if (phutil_is_windows()) {
+      return getenv('APPDATA').'/.arcrc';
+    } else {
+      return getenv('HOME').'/.arcrc';
+    }
   }
 
   public static function readUserConfigurationFile() {
     $user_config = array();
     $user_config_path = self::getUserConfigurationFileLocation();
     if (Filesystem::pathExists($user_config_path)) {
-      $mode = fileperms($user_config_path);
-      if (!$mode) {
-        throw new Exception("Unable to get perms of '{$user_config_path}'!");
-      }
-      if ($mode & 0177) {
-        // Mode should allow only owner access.
-        $prompt = "File permissions on your ~/.arcrc are too open. ".
-                  "Fix them by chmod'ing to 600?";
-        if (!phutil_console_confirm($prompt, $default_no = false)) {
-          throw new ArcanistUsageException("Set ~/.arcrc to file mode 600.");
+
+      if (!phutil_is_windows()) {
+        $mode = fileperms($user_config_path);
+        if (!$mode) {
+          throw new Exception("Unable to get perms of '{$user_config_path}'!");
+        }
+        if ($mode & 0177) {
+          // Mode should allow only owner access.
+          $prompt = "File permissions on your ~/.arcrc are too open. ".
+                    "Fix them by chmod'ing to 600?";
+          if (!phutil_console_confirm($prompt, $default_no = false)) {
+            throw new ArcanistUsageException("Set ~/.arcrc to file mode 600.");
+          }
+          execx('chmod 600 %s', $user_config_path);
         }
-        execx('chmod 600 %s', $user_config_path);
       }
 
       $user_config_data = Filesystem::readFile($user_config_path);
@@ -959,7 +970,10 @@ abstract class ArcanistBaseWorkflow {
 
     $path = self::getUserConfigurationFileLocation();
     Filesystem::writeFile($path, $json);
-    execx('chmod 600 %s', $path);
+
+    if (!phutil_is_windows()) {
+      execx('chmod 600 %s', $path);
+    }
   }
 
 
index e46306be1072fe50686190f2714c411046e9d6d1..8731f5204924921fb49c4529035361aedb3a8c02 100644 (file)
@@ -25,9 +25,15 @@ final class ArcanistBranchWorkflow extends ArcanistBaseWorkflow {
 
   private $branches;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **branch**
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git
           A wrapper on 'git branch'. It pulls data from Differential and
           displays the revision status next to the branch name.
index 713e4840db77b9d3d3a3e4f5f2aa7814bb19c92a..adfea16afcdf54fb47867c9c072272bd2d0bf9af 100644 (file)
  */
 final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **call-conduit** __method__
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: http, https
           Allows you to make a raw Conduit method call:
 
@@ -38,7 +44,6 @@ final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow {
 
             $ echo '{}' | arc call-conduit conduit.ping
             $ echo '{"phid":"PHID-FILE-xxxx"}' | arc call-conduit file.download
-
 EOTEXT
       );
   }
index dca10af6f9558edf195ec80df2ad867d6d992906..04e8acdd5ca09366372f9b797466863da0632800 100644 (file)
@@ -25,9 +25,15 @@ final class ArcanistCommitWorkflow extends ArcanistBaseWorkflow {
 
   private $revisionID;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **commit** [--revision __revision_id__] [--show]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: svn
           Commit a revision which has been accepted by a reviewer.
 EOTEXT
index 6413a8be7db8eee846c67c727ba4b4d676acb791..69afd21a52c2bce3bc7fdabf22bd7334200150ac 100644 (file)
  */
 final class ArcanistCoverWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **cover**
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: svn, git
           Cover your... professional reputation. Show blame for the lines you
           changed in your working copy. This will take a minute because blame
index fbf26e8b5ab34ddc10a3a18f80f9218ee6caa68c..b650868e9bf6eb73e186cf626139905eafad25ff 100644 (file)
@@ -37,10 +37,16 @@ final class ArcanistDiffWorkflow extends ArcanistBaseWorkflow {
   private $revisionID;
   private $unitWorkflow;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **diff** [__paths__] (svn)
       **diff** [__commit__] (git, hg)
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn, hg
           Generate a Differential diff or revision from local changes.
 
@@ -51,7 +57,6 @@ final class ArcanistDiffWorkflow extends ArcanistBaseWorkflow {
           Under svn, you can choose to include only some of the modified files
           in the working copy in the diff by specifying their paths. If you
           omit paths, all changes are included in the diff.
-
 EOTEXT
       );
   }
index 4f7857d65ae2c9bf45eca54ff45ef88ee5c03ce1..e3009ec39a523ae6e5bd9415c854e0de492a5d85 100644 (file)
@@ -27,14 +27,19 @@ final class ArcanistDownloadWorkflow extends ArcanistBaseWorkflow {
   private $saveAs;
   private $show;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **download** __file__ [--as __name__] [--show]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: filesystems
           Download a file to local disk, e.g.:
 
             $ arc download F33              # Download file 'F33'
-
 EOTEXT
       );
   }
index 9b1ce4e8f3e534958280016376829500e0656a6a..7b8873bd1eb448ba00d764b03e498112a030ff57 100644 (file)
@@ -35,12 +35,18 @@ final class ArcanistExportWorkflow extends ArcanistBaseWorkflow {
   private $sourceID;
   private $format;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **export** [__paths__] __format__ (svn)
       **export** [__commit_range__] __format__ (git)
       **export** __--revision__ __revision_id__ __format__
       **export** __--diff__ __diff_id__ __format__
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn
           Export the local changeset (or a Differential changeset) to a file,
           in some __format__: git diff (__--git__), unified diff
index 27d13519f903b456b5b4ae9522202e8607be0a1c..2edc012650ea94526d539e224970463a8e47663b 100644 (file)
  */
 final class ArcanistGitHookPreReceiveWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **git-hook-pre-receive**
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git
           You can install this as a git pre-receive hook.
 EOTEXT
index 8a72513e99322efa8dcd6d55be59884fce4d2652..2c0273a7a408e793ddb80eff42cfbbc954aadef1 100644 (file)
  */
 final class ArcanistHelpWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **help** [__command__]
+      **help** --full
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: english
           Shows this help. With __command__, shows help about a specific
           command.
@@ -35,6 +42,9 @@ EOTEXT
 
   public function getArguments() {
     return array(
+      'full' => array(
+        'help' => 'Print detailed information about each command.',
+      ),
       '*' => 'command',
     );
   }
@@ -59,6 +69,10 @@ EOTEXT
       if ($target && $target != $command) {
         continue;
       }
+      if (!$target && !$this->getArgument('full')) {
+        $cmdref[] = $workflow->getCommandSynopses();
+        continue;
+      }
       $optref = array();
       $arguments = $workflow->getArguments();
 
@@ -133,7 +147,10 @@ EOTEXT
         $optref = "\n";
       }
 
-      $cmdref[] = $workflow->getCommandHelp().$optref;
+      $cmdref[] =
+        $workflow->getCommandSynopses()."\n".
+        $workflow->getCommandHelp().
+        $optref;
     }
     $cmdref = implode("\n\n", $cmdref);
 
@@ -143,19 +160,30 @@ 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__]
-
-      This help file provides a detailed command reference.
+      {$description}
 
 **COMMAND REFERENCE**
 
 {$cmdref}
 
+
+EOTEXT
+    );
+
+    if (!$this->getArgument('full')) {
+      return;
+    }
+
+    echo phutil_console_format(<<<EOTEXT
 **OPTION REFERENCE**
 
       __--trace__
index 38160630e8040cb62077ff30325480cf6c23e766..5ffb78cd3d19514a9f6cd424e532608a46fb5324 100644 (file)
  */
 final class ArcanistInstallCertificateWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **install-certificate** [uri]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: http, https
           Installs Conduit credentials into your ~/.arcrc for the given install
           of Phabricator. You need to do this before you can use 'arc', as it
index 3641dc2fb6ad10c9e524206f20bbcf6a3828db68..746ed8cca927d980b35e272d1e41a40fd8f40ad7 100644 (file)
  */
 final class ArcanistLandWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **land** [__options__] __branch__ [--onto __master__]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git
 
           Land an accepted change (currently sitting in local feature branch
@@ -37,7 +43,6 @@ final class ArcanistLandWorkflow extends ArcanistBaseWorkflow {
           immutable repositories (or when --merge is provided), it will perform
           a --no-ff merge (the branch will always be merged into __master__ with
           a merge commit).
-
 EOTEXT
       );
   }
index f779d348eb57d21bbfe9472788b880c62c1f35d0..934b073a30e16aeb4bd3c21459321963cebf8ac2 100644 (file)
  */
 final class ArcanistLiberateWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **liberate** [__path__]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: libphutil
           Create or update a libphutil library, generating required metadata
           files like \__init__.php.
index b652ea6d2c937246efc3518c693b739123befa02..93c824330c3c9b672e73e8246d703a050f5563a9 100644 (file)
@@ -36,10 +36,16 @@ class ArcanistLintWorkflow extends ArcanistBaseWorkflow {
     return $this;
   }
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **lint** [__options__] [__paths__]
       **lint** [__options__] --rev [__rev__]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn, hg
           Run static analysis on changes to check for mistakes. If no files
           are specified, lint will be run on all files which have been modified.
index 4e63e56cf22ebe927509333894390efc84747a89..d165156d10f6b620c5fefc3c3b9adaee9589ca27 100644 (file)
  */
 final class ArcanistListWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **list**
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn, hg
           List your open Differential revisions.
 EOTEXT
index e8bbfa2f037270e29786e0ac71eb891bbcc612ed..ff56bf4f036a67d21bad9a93f66842bf2d0d540f 100644 (file)
  */
 final class ArcanistMarkCommittedWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **mark-committed** __revision__
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn
           Manually mark a revision as committed. You should not normally need
           to do this; arc commit (svn), arc amend (git), arc merge (git, hg) or
index b572a54e0ed7fff3a3b2230e37a4c2cef353c24f..22c9f32d5425396499899399f0ff1c1242a8ff7c 100644 (file)
  */
 final class ArcanistMergeWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **merge**
-          Deprecated.
+EOTEXT
+      );
+  }
 
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
+          Deprecated.
 EOTEXT
       );
   }
index 798ab3d8a9644f2a9ec0ad2cc0ebdb066b1345a3..0a77a4d0cb95bf2b06a51600bfbd34c4d9a4a1cc 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,10 +28,16 @@ final class ArcanistPasteWorkflow extends ArcanistBaseWorkflow {
   private $title;
   private $json;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **paste** [--title __title__] [--lang __language__] [--json]
       **paste** __id__ [--json]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: text
           Share and grab text using the Paste application. To create a paste,
           use stdin to provide the text:
@@ -41,7 +47,6 @@ final class ArcanistPasteWorkflow extends ArcanistBaseWorkflow {
           To retrieve a paste, specify the paste ID:
 
             $ arc paste P123
-
 EOTEXT
       );
   }
index 57bd233ddbe27470b4559594da3a381d0cb76e69..daa6a55c64982411784b03b861d547fcde2f3c6b 100644 (file)
@@ -31,13 +31,19 @@ final class ArcanistPatchWorkflow extends ArcanistBaseWorkflow {
   private $source;
   private $sourceParam;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **patch** __D12345__
       **patch** __--revision__ __revision_id__
       **patch** __--diff__ __diff_id__
       **patch** __--patch__ __file__
       **patch** __--arcbundle__ __bundlefile__
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn, hg
           Apply the changes in a Differential revision, patchfile, or arc
           bundle to the working copy.
index 17358089ed1814fead0a89a31bf90f87aa917ffb..1f0d7941f241abd767767b6e7b6301c6eacb3a8d 100644 (file)
  */
 final class ArcanistShellCompleteWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **shell-complete** __--current__ __N__ -- [__argv__]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: bash, etc.
           Implements shell completion. To use shell completion, source the
           appropriate script from 'resources/shell/' in your .shellrc.
index a8fc9ddec46598eef956c034bee64f1dd7bf2705..975f8511b06bca669b9b76338889dd658bb9f6dc 100644 (file)
  */
 final class ArcanistSvnHookPreCommitWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **svn-hook-pre-commit** __repository__ __transaction__
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: svn
           You can install this as an SVN pre-commit hook. For more information,
           see the article "Installing Arcanist SVN Hooks" in the Arcanist
index bd2e08e69fad5a6e58d4ce58f3a8ad61ba8cc714..f263d049a86c2e86b27246e2628fbe40677f0f7f 100644 (file)
@@ -33,10 +33,16 @@ final class ArcanistUnitWorkflow extends ArcanistBaseWorkflow {
   private $testResults;
   private $engine;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **unit** [__options__] [__paths__]
       **unit** [__options__] --rev [__rev__]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: git, svn, hg
           Run unit tests that cover specified paths. If no paths are specified,
           unit tests covering all modified files will be run.
index 0bbbe1a1f93f4e3d8ecf53d4027c3ce035440a69..ea108259405f29f1522104ea5321d774612ed5d7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,12 +26,17 @@ final class ArcanistUploadWorkflow extends ArcanistBaseWorkflow {
   private $paths;
   private $json;
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **upload** __file__ [__file__ ...] [--json]
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: filesystems
           Upload a file from local disk.
-
 EOTEXT
       );
   }
index d344b0e15e1adef36b5a7cdfc195abd19077d5ac..56919bdf972a5a0bee0f9ebcbe377bf611930350 100644 (file)
  */
 final class ArcanistWhichWorkflow extends ArcanistBaseWorkflow {
 
-  public function getCommandHelp() {
+  public function getCommandSynopses() {
     return phutil_console_format(<<<EOTEXT
       **which** (svn)
       **which** [commit] (hg, git)
+EOTEXT
+      );
+  }
+
+  public function getCommandHelp() {
+    return phutil_console_format(<<<EOTEXT
           Supports: svn, git, hg
           Shows which revision is in the working copy (or which revisions, if
           more than one matches).