1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 14:52:40 +01:00

Improve arc compatibility on Windows

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
This commit is contained in:
epriestley 2012-03-05 10:02:37 -08:00
parent eae497152c
commit 2f9a422bc6
29 changed files with 264 additions and 61 deletions

View file

@ -17,7 +17,10 @@
*/ */
$include_path = ini_get('include_path'); $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'; @include_once 'libphutil/src/__phutil_library_init__.php';
if (!@constant('__LIBPHUTIL__')) { if (!@constant('__LIBPHUTIL__')) {
echo "ERROR: Unable to load libphutil. Update your PHP 'include_path' to ". echo "ERROR: Unable to load libphutil. Update your PHP 'include_path' to ".
@ -25,7 +28,7 @@ if (!@constant('__LIBPHUTIL__')) {
exit(1); 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 // There may be some kind of auto-prepend script configured which starts an
// output buffer. Discard any such output buffers. // output buffer. Discard any such output buffers.

View file

@ -331,15 +331,23 @@ function sanity_check_environment() {
"'{$min_version}'."); "'{$min_version}'.");
} }
// NOTE: We don't have phutil_is_windows() yet here.
if (DIRECTORY_SEPARATOR != '/') {
$need_functions = array( $need_functions = array(
'json_decode' => '--without-json', 'curl_init' => array('builtin-dll', 'php_curl.dll'),
); );
} else {
$need_functions = array(
'json_decode' => array('flag', '--without-json'),
);
}
$problems = array(); $problems = array();
$config = null; $config = null;
$show_config = false; $show_config = false;
foreach ($need_functions as $fname => $flag) { foreach ($need_functions as $fname => $resolution) {
if (function_exists($fname)) { if (function_exists($fname)) {
continue; 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; $show_config = true;
$generic = false;
$problems[] = $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 ". "which means it does not have the function '{$fname}()'. This ".
"function is required for arc to run. Rebuild PHP without this flag. ". "function is required for arc to run. Rebuild PHP without this flag. ".
"You may also be able to build or install the relevant extension ". "You may also be able to build or install the relevant extension ".
"separately."; "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[] = $problems[] =
"This build of PHP is missing the required function '{$fname}()'. ". "This build of PHP is missing the required function '{$fname}()'. ".
"Rebuild PHP or install the extension which provides '{$fname}()'."; "Rebuild PHP or install the extension which provides '{$fname}()'.";

View file

@ -34,7 +34,7 @@ $builtin = array(
'print' => true, 'print' => true,
'exit' => true, 'exit' => true,
'die' => true, 'die' => true,
'phutil_load_library' => true, 'phutil_is_windows' => true,
// HPHP/i defines these functions as 'internal', but they are NOT // 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 // builtins and do not exist in vanilla PHP. Make sure we don't mark them

View file

@ -23,11 +23,17 @@
*/ */
final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow { final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**alias** **alias**
**alias** __command__ **alias** __command__
**alias** __command__ __target__ -- [__options__] **alias** __command__ __target__ -- [__options__]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: cli Supports: cli
Create an alias from __command__ to __target__ (optionally, with Create an alias from __command__ to __target__ (optionally, with
__options__). For example: __options__). For example:
@ -46,7 +52,6 @@ final class ArcanistAliasWorkflow extends ArcanistBaseWorkflow {
arc alias fpatch arc alias fpatch
Without any arguments, 'arc alias' will list aliases. Without any arguments, 'arc alias' will list aliases.
EOTEXT EOTEXT
); );
} }

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistAmendWorkflow extends ArcanistBaseWorkflow { final class ArcanistAmendWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**amend** [--revision __revision_id__] [--show] **amend** [--revision __revision_id__] [--show]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git Supports: git
Amend the working copy after a revision has been accepted, so commits Amend the working copy after a revision has been accepted, so commits
can be marked 'committed' and pushed upstream. can be marked 'committed' and pushed upstream.

View file

@ -374,6 +374,10 @@ abstract class ArcanistBaseWorkflow {
return $this->arcanistConfiguration; return $this->arcanistConfiguration;
} }
public function getCommandSynopses() {
return get_class($this).": Undocumented";
}
public function getCommandHelp() { public function getCommandHelp() {
return get_class($this).": Undocumented"; return get_class($this).": Undocumented";
} }
@ -921,13 +925,19 @@ abstract class ArcanistBaseWorkflow {
} }
public static function getUserConfigurationFileLocation() { public static function getUserConfigurationFileLocation() {
if (phutil_is_windows()) {
return getenv('APPDATA').'/.arcrc';
} else {
return getenv('HOME').'/.arcrc'; return getenv('HOME').'/.arcrc';
} }
}
public static function readUserConfigurationFile() { public static function readUserConfigurationFile() {
$user_config = array(); $user_config = array();
$user_config_path = self::getUserConfigurationFileLocation(); $user_config_path = self::getUserConfigurationFileLocation();
if (Filesystem::pathExists($user_config_path)) { if (Filesystem::pathExists($user_config_path)) {
if (!phutil_is_windows()) {
$mode = fileperms($user_config_path); $mode = fileperms($user_config_path);
if (!$mode) { if (!$mode) {
throw new Exception("Unable to get perms of '{$user_config_path}'!"); throw new Exception("Unable to get perms of '{$user_config_path}'!");
@ -941,6 +951,7 @@ abstract class ArcanistBaseWorkflow {
} }
execx('chmod 600 %s', $user_config_path); execx('chmod 600 %s', $user_config_path);
} }
}
$user_config_data = Filesystem::readFile($user_config_path); $user_config_data = Filesystem::readFile($user_config_path);
$user_config = json_decode($user_config_data, true); $user_config = json_decode($user_config_data, true);
@ -959,8 +970,11 @@ abstract class ArcanistBaseWorkflow {
$path = self::getUserConfigurationFileLocation(); $path = self::getUserConfigurationFileLocation();
Filesystem::writeFile($path, $json); Filesystem::writeFile($path, $json);
if (!phutil_is_windows()) {
execx('chmod 600 %s', $path); execx('chmod 600 %s', $path);
} }
}
/** /**

View file

@ -25,9 +25,15 @@ final class ArcanistBranchWorkflow extends ArcanistBaseWorkflow {
private $branches; private $branches;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**branch** **branch**
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git Supports: git
A wrapper on 'git branch'. It pulls data from Differential and A wrapper on 'git branch'. It pulls data from Differential and
displays the revision status next to the branch name. displays the revision status next to the branch name.

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow { final class ArcanistCallConduitWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**call-conduit** __method__ **call-conduit** __method__
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: http, https Supports: http, https
Allows you to make a raw Conduit method call: 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 '{}' | arc call-conduit conduit.ping
$ echo '{"phid":"PHID-FILE-xxxx"}' | arc call-conduit file.download $ echo '{"phid":"PHID-FILE-xxxx"}' | arc call-conduit file.download
EOTEXT EOTEXT
); );
} }

View file

@ -25,9 +25,15 @@ final class ArcanistCommitWorkflow extends ArcanistBaseWorkflow {
private $revisionID; private $revisionID;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**commit** [--revision __revision_id__] [--show] **commit** [--revision __revision_id__] [--show]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: svn Supports: svn
Commit a revision which has been accepted by a reviewer. Commit a revision which has been accepted by a reviewer.
EOTEXT EOTEXT

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistCoverWorkflow extends ArcanistBaseWorkflow { final class ArcanistCoverWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**cover** **cover**
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: svn, git Supports: svn, git
Cover your... professional reputation. Show blame for the lines you Cover your... professional reputation. Show blame for the lines you
changed in your working copy. This will take a minute because blame changed in your working copy. This will take a minute because blame

View file

@ -37,10 +37,16 @@ final class ArcanistDiffWorkflow extends ArcanistBaseWorkflow {
private $revisionID; private $revisionID;
private $unitWorkflow; private $unitWorkflow;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**diff** [__paths__] (svn) **diff** [__paths__] (svn)
**diff** [__commit__] (git, hg) **diff** [__commit__] (git, hg)
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn, hg Supports: git, svn, hg
Generate a Differential diff or revision from local changes. 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 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 in the working copy in the diff by specifying their paths. If you
omit paths, all changes are included in the diff. omit paths, all changes are included in the diff.
EOTEXT EOTEXT
); );
} }

View file

@ -27,14 +27,19 @@ final class ArcanistDownloadWorkflow extends ArcanistBaseWorkflow {
private $saveAs; private $saveAs;
private $show; private $show;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**download** __file__ [--as __name__] [--show] **download** __file__ [--as __name__] [--show]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: filesystems Supports: filesystems
Download a file to local disk, e.g.: Download a file to local disk, e.g.:
$ arc download F33 # Download file 'F33' $ arc download F33 # Download file 'F33'
EOTEXT EOTEXT
); );
} }

View file

@ -35,12 +35,18 @@ final class ArcanistExportWorkflow extends ArcanistBaseWorkflow {
private $sourceID; private $sourceID;
private $format; private $format;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**export** [__paths__] __format__ (svn) **export** [__paths__] __format__ (svn)
**export** [__commit_range__] __format__ (git) **export** [__commit_range__] __format__ (git)
**export** __--revision__ __revision_id__ __format__ **export** __--revision__ __revision_id__ __format__
**export** __--diff__ __diff_id__ __format__ **export** __--diff__ __diff_id__ __format__
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn Supports: git, svn
Export the local changeset (or a Differential changeset) to a file, Export the local changeset (or a Differential changeset) to a file,
in some __format__: git diff (__--git__), unified diff in some __format__: git diff (__--git__), unified diff

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistGitHookPreReceiveWorkflow extends ArcanistBaseWorkflow { final class ArcanistGitHookPreReceiveWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**git-hook-pre-receive** **git-hook-pre-receive**
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git Supports: git
You can install this as a git pre-receive hook. You can install this as a git pre-receive hook.
EOTEXT EOTEXT

View file

@ -23,9 +23,16 @@
*/ */
final class ArcanistHelpWorkflow extends ArcanistBaseWorkflow { final class ArcanistHelpWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**help** [__command__] **help** [__command__]
**help** --full
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: english Supports: english
Shows this help. With __command__, shows help about a specific Shows this help. With __command__, shows help about a specific
command. command.
@ -35,6 +42,9 @@ EOTEXT
public function getArguments() { public function getArguments() {
return array( return array(
'full' => array(
'help' => 'Print detailed information about each command.',
),
'*' => 'command', '*' => 'command',
); );
} }
@ -59,6 +69,10 @@ EOTEXT
if ($target && $target != $command) { if ($target && $target != $command) {
continue; continue;
} }
if (!$target && !$this->getArgument('full')) {
$cmdref[] = $workflow->getCommandSynopses();
continue;
}
$optref = array(); $optref = array();
$arguments = $workflow->getArguments(); $arguments = $workflow->getArguments();
@ -133,7 +147,10 @@ EOTEXT
$optref = "\n"; $optref = "\n";
} }
$cmdref[] = $workflow->getCommandHelp().$optref; $cmdref[] =
$workflow->getCommandSynopses()."\n".
$workflow->getCommandHelp().
$optref;
} }
$cmdref = implode("\n\n", $cmdref); $cmdref = implode("\n\n", $cmdref);
@ -143,19 +160,30 @@ EOTEXT
} }
$self = 'arc'; $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 echo phutil_console_format(<<<EOTEXT
**NAME** **NAME**
**{$self}** - arcanist, a code review and revision management utility **{$self}** - arcanist, a code review and revision management utility
**SYNOPSIS** **SYNOPSIS**
**{$self}** __command__ [__options__] [__args__] **{$self}** __command__ [__options__] [__args__]
{$description}
This help file provides a detailed command reference.
**COMMAND REFERENCE** **COMMAND REFERENCE**
{$cmdref} {$cmdref}
EOTEXT
);
if (!$this->getArgument('full')) {
return;
}
echo phutil_console_format(<<<EOTEXT
**OPTION REFERENCE** **OPTION REFERENCE**
__--trace__ __--trace__

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistInstallCertificateWorkflow extends ArcanistBaseWorkflow { final class ArcanistInstallCertificateWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**install-certificate** [uri] **install-certificate** [uri]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: http, https Supports: http, https
Installs Conduit credentials into your ~/.arcrc for the given install Installs Conduit credentials into your ~/.arcrc for the given install
of Phabricator. You need to do this before you can use 'arc', as it of Phabricator. You need to do this before you can use 'arc', as it

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistLandWorkflow extends ArcanistBaseWorkflow { final class ArcanistLandWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**land** [__options__] __branch__ [--onto __master__] **land** [__options__] __branch__ [--onto __master__]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git Supports: git
Land an accepted change (currently sitting in local feature branch 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 immutable repositories (or when --merge is provided), it will perform
a --no-ff merge (the branch will always be merged into __master__ with a --no-ff merge (the branch will always be merged into __master__ with
a merge commit). a merge commit).
EOTEXT EOTEXT
); );
} }

View file

@ -29,9 +29,15 @@
*/ */
final class ArcanistLiberateWorkflow extends ArcanistBaseWorkflow { final class ArcanistLiberateWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**liberate** [__path__] **liberate** [__path__]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: libphutil Supports: libphutil
Create or update a libphutil library, generating required metadata Create or update a libphutil library, generating required metadata
files like \__init__.php. files like \__init__.php.

View file

@ -36,10 +36,16 @@ class ArcanistLintWorkflow extends ArcanistBaseWorkflow {
return $this; return $this;
} }
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**lint** [__options__] [__paths__] **lint** [__options__] [__paths__]
**lint** [__options__] --rev [__rev__] **lint** [__options__] --rev [__rev__]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn, hg Supports: git, svn, hg
Run static analysis on changes to check for mistakes. If no files 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. are specified, lint will be run on all files which have been modified.

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistListWorkflow extends ArcanistBaseWorkflow { final class ArcanistListWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**list** **list**
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn, hg Supports: git, svn, hg
List your open Differential revisions. List your open Differential revisions.
EOTEXT EOTEXT

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistMarkCommittedWorkflow extends ArcanistBaseWorkflow { final class ArcanistMarkCommittedWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**mark-committed** __revision__ **mark-committed** __revision__
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn Supports: git, svn
Manually mark a revision as committed. You should not normally need 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 to do this; arc commit (svn), arc amend (git), arc merge (git, hg) or

View file

@ -26,11 +26,16 @@
*/ */
final class ArcanistMergeWorkflow extends ArcanistBaseWorkflow { final class ArcanistMergeWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**merge** **merge**
Deprecated. EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Deprecated.
EOTEXT EOTEXT
); );
} }

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 $title;
private $json; private $json;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**paste** [--title __title__] [--lang __language__] [--json] **paste** [--title __title__] [--lang __language__] [--json]
**paste** __id__ [--json] **paste** __id__ [--json]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: text Supports: text
Share and grab text using the Paste application. To create a paste, Share and grab text using the Paste application. To create a paste,
use stdin to provide the text: use stdin to provide the text:
@ -41,7 +47,6 @@ final class ArcanistPasteWorkflow extends ArcanistBaseWorkflow {
To retrieve a paste, specify the paste ID: To retrieve a paste, specify the paste ID:
$ arc paste P123 $ arc paste P123
EOTEXT EOTEXT
); );
} }

View file

@ -31,13 +31,19 @@ final class ArcanistPatchWorkflow extends ArcanistBaseWorkflow {
private $source; private $source;
private $sourceParam; private $sourceParam;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**patch** __D12345__ **patch** __D12345__
**patch** __--revision__ __revision_id__ **patch** __--revision__ __revision_id__
**patch** __--diff__ __diff_id__ **patch** __--diff__ __diff_id__
**patch** __--patch__ __file__ **patch** __--patch__ __file__
**patch** __--arcbundle__ __bundlefile__ **patch** __--arcbundle__ __bundlefile__
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn, hg Supports: git, svn, hg
Apply the changes in a Differential revision, patchfile, or arc Apply the changes in a Differential revision, patchfile, or arc
bundle to the working copy. bundle to the working copy.

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistShellCompleteWorkflow extends ArcanistBaseWorkflow { final class ArcanistShellCompleteWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**shell-complete** __--current__ __N__ -- [__argv__] **shell-complete** __--current__ __N__ -- [__argv__]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: bash, etc. Supports: bash, etc.
Implements shell completion. To use shell completion, source the Implements shell completion. To use shell completion, source the
appropriate script from 'resources/shell/' in your .shellrc. appropriate script from 'resources/shell/' in your .shellrc.

View file

@ -23,9 +23,15 @@
*/ */
final class ArcanistSvnHookPreCommitWorkflow extends ArcanistBaseWorkflow { final class ArcanistSvnHookPreCommitWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**svn-hook-pre-commit** __repository__ __transaction__ **svn-hook-pre-commit** __repository__ __transaction__
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: svn Supports: svn
You can install this as an SVN pre-commit hook. For more information, You can install this as an SVN pre-commit hook. For more information,
see the article "Installing Arcanist SVN Hooks" in the Arcanist see the article "Installing Arcanist SVN Hooks" in the Arcanist

View file

@ -33,10 +33,16 @@ final class ArcanistUnitWorkflow extends ArcanistBaseWorkflow {
private $testResults; private $testResults;
private $engine; private $engine;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**unit** [__options__] [__paths__] **unit** [__options__] [__paths__]
**unit** [__options__] --rev [__rev__] **unit** [__options__] --rev [__rev__]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: git, svn, hg Supports: git, svn, hg
Run unit tests that cover specified paths. If no paths are specified, Run unit tests that cover specified paths. If no paths are specified,
unit tests covering all modified files will be run. unit tests covering all modified files will be run.

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 $paths;
private $json; private $json;
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**upload** __file__ [__file__ ...] [--json] **upload** __file__ [__file__ ...] [--json]
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: filesystems Supports: filesystems
Upload a file from local disk. Upload a file from local disk.
EOTEXT EOTEXT
); );
} }

View file

@ -23,10 +23,16 @@
*/ */
final class ArcanistWhichWorkflow extends ArcanistBaseWorkflow { final class ArcanistWhichWorkflow extends ArcanistBaseWorkflow {
public function getCommandHelp() { public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT return phutil_console_format(<<<EOTEXT
**which** (svn) **which** (svn)
**which** [commit] (hg, git) **which** [commit] (hg, git)
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Supports: svn, git, hg Supports: svn, git, hg
Shows which revision is in the working copy (or which revisions, if Shows which revision is in the working copy (or which revisions, if
more than one matches). more than one matches).