diff --git a/scripts/init/init-arcanist.php b/scripts/init/init-arcanist.php index 2dc4fb65..5c5ab0d0 100644 --- a/scripts/init/init-arcanist.php +++ b/scripts/init/init-arcanist.php @@ -75,6 +75,17 @@ final class ArcanistRuntime { $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 index 12588392..32df6182 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -187,6 +187,7 @@ phutil_register_library_map(array( '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 @@ phutil_register_library_map(array( '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 index 7944c2f1..7f0929b0 100644 --- a/src/toolset/ArcanistAliasWorkflow.php +++ b/src/toolset/ArcanistAliasWorkflow.php @@ -132,7 +132,7 @@ EOTEXT 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 index 00000000..83838071 --- /dev/null +++ b/src/toolset/ArcanistHelpWorkflow.php @@ -0,0 +1,13 @@ +