Changeset View
Changeset View
Standalone View
Standalone View
src/parser/argument/workflow/PhutilHelpArgumentWorkflow.php
Show All 34 Lines | EOHELP | ||||
public function isExecutable() { | public function isExecutable() { | ||||
return true; | return true; | ||||
} | } | ||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$with = $args->getArg('help-with-what'); | $with = $args->getArg('help-with-what'); | ||||
$runtime = $this->getRuntime(); | $runtime = $this->getRuntime(); | ||||
if ($runtime) { | |||||
$toolset = $runtime->getToolset(); | $toolset = $runtime->getToolset(); | ||||
if ($toolset->getToolsetKey() === 'arc') { | if ($toolset->getToolsetKey() === 'arc') { | ||||
$workflows = $args->getWorkflows(); | $workflows = $args->getWorkflows(); | ||||
$legacy = array(); | $legacy = array(); | ||||
$legacy[] = new ArcanistCloseRevisionWorkflow(); | $legacy[] = new ArcanistCloseRevisionWorkflow(); | ||||
$legacy[] = new ArcanistCommitWorkflow(); | $legacy[] = new ArcanistCommitWorkflow(); | ||||
$legacy[] = new ArcanistCoverWorkflow(); | $legacy[] = new ArcanistCoverWorkflow(); | ||||
$legacy[] = new ArcanistDiffWorkflow(); | $legacy[] = new ArcanistDiffWorkflow(); | ||||
$legacy[] = new ArcanistExportWorkflow(); | $legacy[] = new ArcanistExportWorkflow(); | ||||
$legacy[] = new ArcanistGetConfigWorkflow(); | $legacy[] = new ArcanistGetConfigWorkflow(); | ||||
$legacy[] = new ArcanistSetConfigWorkflow(); | $legacy[] = new ArcanistSetConfigWorkflow(); | ||||
$legacy[] = new ArcanistInstallCertificateWorkflow(); | $legacy[] = new ArcanistInstallCertificateWorkflow(); | ||||
$legacy[] = new ArcanistLandWorkflow(); | $legacy[] = new ArcanistLandWorkflow(); | ||||
$legacy[] = new ArcanistLintersWorkflow(); | $legacy[] = new ArcanistLintersWorkflow(); | ||||
$legacy[] = new ArcanistLintWorkflow(); | $legacy[] = new ArcanistLintWorkflow(); | ||||
$legacy[] = new ArcanistListWorkflow(); | $legacy[] = new ArcanistListWorkflow(); | ||||
$legacy[] = new ArcanistPatchWorkflow(); | $legacy[] = new ArcanistPatchWorkflow(); | ||||
$legacy[] = new ArcanistPasteWorkflow(); | $legacy[] = new ArcanistPasteWorkflow(); | ||||
$legacy[] = new ArcanistTasksWorkflow(); | $legacy[] = new ArcanistTasksWorkflow(); | ||||
$legacy[] = new ArcanistTodoWorkflow(); | $legacy[] = new ArcanistTodoWorkflow(); | ||||
$legacy[] = new ArcanistUnitWorkflow(); | $legacy[] = new ArcanistUnitWorkflow(); | ||||
$legacy[] = new ArcanistWhichWorkflow(); | $legacy[] = new ArcanistWhichWorkflow(); | ||||
foreach ($legacy as $workflow) { | foreach ($legacy as $workflow) { | ||||
// If this workflow has been updated but not removed from the list | // If this workflow has been updated but not removed from the list | ||||
// above yet, just skip it. | // above yet, just skip it. | ||||
if ($workflow instanceof ArcanistArcWorkflow) { | if ($workflow instanceof ArcanistArcWorkflow) { | ||||
continue; | continue; | ||||
} | } | ||||
$workflows[] = $workflow->newLegacyPhutilWorkflow(); | $workflows[] = $workflow->newLegacyPhutilWorkflow(); | ||||
} | } | ||||
$args->setWorkflows($workflows); | $args->setWorkflows($workflows); | ||||
} | } | ||||
} | |||||
if (!$with) { | if (!$with) { | ||||
$args->printHelpAndExit(); | $args->printHelpAndExit(); | ||||
} else { | } else { | ||||
foreach ($with as $thing) { | foreach ($with as $thing) { | ||||
echo phutil_console_format( | echo phutil_console_format( | ||||
"**%s**\n\n", | "**%s**\n\n", | ||||
pht('%s WORKFLOW', strtoupper($thing))); | pht('%s WORKFLOW', strtoupper($thing))); | ||||
echo $args->renderWorkflowHelp($thing, $show_flags = true); | echo $args->renderWorkflowHelp($thing, $show_flags = true); | ||||
echo "\n"; | echo "\n"; | ||||
} | } | ||||
exit(PhutilArgumentParser::PARSE_ERROR_CODE); | exit(PhutilArgumentParser::PARSE_ERROR_CODE); | ||||
} | } | ||||
} | } | ||||
} | } |