Index: scripts/init/init-arcanist.php =================================================================== --- scripts/init/init-arcanist.php +++ 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; Index: src/__phutil_library_map__.php =================================================================== --- src/__phutil_library_map__.php +++ 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', Index: src/toolset/ArcanistAliasWorkflow.php =================================================================== --- src/toolset/ArcanistAliasWorkflow.php +++ src/toolset/ArcanistAliasWorkflow.php @@ -132,7 +132,7 @@ public static function resolveAliases( $command, - ArcanistConfiguration $config, + ArcanistRuntime $config, array $argv, ArcanistConfigurationManager $configuration_manager) { Index: src/toolset/ArcanistHelpWorkflow.php =================================================================== --- /dev/null +++ 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(); + } + +}