Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/ArcanistVersionWorkflow.php
- This file was moved from src/workflow/ArcanistVersionWorkflow.php.
| <?php | <?php | ||||
| /** | /** | ||||
| * Display the current version of Arcanist. | * Display the current version of Arcanist. | ||||
| */ | */ | ||||
| final class ArcanistVersionWorkflow extends ArcanistWorkflow { | final class ArcanistVersionWorkflow extends ArcanistWorkflow { | ||||
| public function supportsToolset(ArcanistToolset $toolset) { | |||||
| return true; | |||||
| } | |||||
| public function getWorkflowName() { | public function getWorkflowName() { | ||||
| return 'version'; | return 'version'; | ||||
| } | } | ||||
| public function getCommandSynopses() { | public function getWorkflowSynopses() { | ||||
| return phutil_console_format(<<<EOTEXT | return array( | ||||
| **version** [__options__] | '**version**', | ||||
| EOTEXT | |||||
| ); | ); | ||||
| } | } | ||||
| public function getCommandHelp() { | public function getWorkflowHelp() { | ||||
| return phutil_console_format(pht(<<<EOTEXT | return pht(<<<EOTEXT | ||||
| Supports: cli | Shows the current version of **%s**. | ||||
| Shows the current version of arcanist. | |||||
| EOTEXT | EOTEXT | ||||
| )); | , | ||||
| $this->getToolsetKey()); | |||||
| } | } | ||||
| public function run() { | public function run() { | ||||
| // TODO: Show the toolset version, not just the "arc" version. | |||||
| $console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
| if (!Filesystem::binaryExists('git')) { | if (!Filesystem::binaryExists('git')) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| pht( | pht( | ||||
| 'Cannot display current version without having `%s` installed.', | 'Cannot display current version without having `%s` installed.', | ||||
| 'git')); | 'git')); | ||||
| } | } | ||||
| Show All 36 Lines | |||||