1<?php
2
3final class ArcanistAnoidWorkflow
4  extends ArcanistArcWorkflow {
5
6  public function getWorkflowName() {
7    return 'anoid';
8  }
9
10  public function getWorkflowInformation() {
11    $help = pht(<<<EOTEXT
12Take control of a probe launched from the science vessel "Arcanoid".
13EOTEXT
14);
15
16    return $this->newWorkflowInformation()
17      ->setSynopsis(pht('Pilot a probe from the vessel "Arcanoid".'))
18      ->addExample(pht('**anoid**'))
19      ->setHelp($help);
20  }
21
22  public function getWorkflowArguments() {
23    return array();
24  }
25
26  public function runWorkflow() {
27    if (!Filesystem::binaryExists('%%PYTHON_CMD%%')) {
28      throw new PhutilArgumentUsageException(
29        pht(
30          'The "arc anoid" workflow requires "%%PYTHON_CMD%%" to be available.'));
31    }
32
33    $support_dir = phutil_get_library_root('arcanist');
34    $support_dir = dirname($support_dir);
35    $support_dir = $support_dir.'/support/';
36
37    $bin = $support_dir.'arcanoid/arcanoid.py';
38
39    return phutil_passthru('%R', $bin);
40  }
41
42}
43