Page MenuHomePhabricator

D19679.diff
No OneTemporary

D19679.diff

diff --git a/scripts/init/init-arcanist.php b/scripts/init/init-arcanist.php
--- a/scripts/init/init-arcanist.php
+++ b/scripts/init/init-arcanist.php
@@ -75,6 +75,17 @@
$unconsumed_argv = $args->getUnconsumedArgumentVector();
+ if (!$unconsumed_argv) {
+ // TOOLSETS: This means the user just ran "arc" or some other top-level
+ // toolset without any workflow argument. We should give them a summary
+ // of the toolset, a list of workflows, and a pointer to "arc help" for
+ // more details.
+
+ // A possible exception is "arc --help", which should perhaps pass
+ // through and act like "arc help".
+ throw new PhutilArgumentUsageException(pht('Choose a workflow!'));
+ }
+
$result = $this->resolveAliases($workflows, $unconsumed_argv, $config);
if (is_int($result)) {
return $result;
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -187,6 +187,7 @@
'ArcanistHLintLinter' => 'lint/linter/ArcanistHLintLinter.php',
'ArcanistHLintLinterTestCase' => 'lint/linter/__tests__/ArcanistHLintLinterTestCase.php',
'ArcanistHardpointLoader' => 'loader/ArcanistHardpointLoader.php',
+ 'ArcanistHelpWorkflow' => 'toolset/ArcanistHelpWorkflow.php',
'ArcanistHexadecimalNumericScalarCasingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistHexadecimalNumericScalarCasingXHPASTLinterRule.php',
'ArcanistHexadecimalNumericScalarCasingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistHexadecimalNumericScalarCasingXHPASTLinterRuleTestCase.php',
'ArcanistHgClientChannel' => 'hgdaemon/ArcanistHgClientChannel.php',
@@ -639,6 +640,7 @@
'ArcanistHLintLinter' => 'ArcanistExternalLinter',
'ArcanistHLintLinterTestCase' => 'ArcanistExternalLinterTestCase',
'ArcanistHardpointLoader' => 'Phobject',
+ 'ArcanistHelpWorkflow' => 'ArcanistWorkflow',
'ArcanistHexadecimalNumericScalarCasingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
'ArcanistHexadecimalNumericScalarCasingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
'ArcanistHgClientChannel' => 'PhutilProtocolChannel',
diff --git a/src/toolset/ArcanistAliasWorkflow.php b/src/toolset/ArcanistAliasWorkflow.php
--- a/src/toolset/ArcanistAliasWorkflow.php
+++ b/src/toolset/ArcanistAliasWorkflow.php
@@ -132,7 +132,7 @@
public static function resolveAliases(
$command,
- ArcanistConfiguration $config,
+ ArcanistRuntime $config,
array $argv,
ArcanistConfigurationManager $configuration_manager) {
diff --git a/src/toolset/ArcanistHelpWorkflow.php b/src/toolset/ArcanistHelpWorkflow.php
new file mode 100644
--- /dev/null
+++ b/src/toolset/ArcanistHelpWorkflow.php
@@ -0,0 +1,13 @@
+<?php
+
+final class ArcanistHelpWorkflow extends ArcanistWorkflow {
+
+ public function getWorkflowName() {
+ return 'help';
+ }
+
+ public function newPhutilWorkflow() {
+ return new PhutilHelpArgumentWorkflow();
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 8, 8:26 PM (2 w, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383880
Default Alt Text
D19679.diff (2 KB)

Event Timeline