Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/workflow/ArcanistShellCompleteWorkflow.php
<?php | <?php | ||||
final class ArcanistShellCompleteWorkflow | final class ArcanistShellCompleteWorkflow | ||||
extends ArcanistWorkflow { | extends ArcanistWorkflow { | ||||
public function supportsToolset(ArcanistToolset $toolset) { | public function supportsToolset(ArcanistToolset $toolset) { | ||||
return true; | return true; | ||||
} | } | ||||
public function getWorkflowName() { | public function getWorkflowName() { | ||||
return 'shell-complete'; | return 'shell-complete'; | ||||
} | } | ||||
public function getWorkflowInformation() { | public function getWorkflowInformation() { | ||||
$help = pht(<<<EOTEXT | $help = pht(<<<EOTEXT | ||||
Install shell completion so you can use the "tab" key to autocomplete | Install shell completion so you can use the "tab" key to autocomplete | ||||
commands and flags in your shell for Arcanist toolsets and workflows. | commands and flags in your shell for toolsets and workflows. | ||||
The **bash** shell is supported. | The **bash** shell is supported. | ||||
**Installing Completion** | **Installing Completion** | ||||
To install shell completion, run the command: | To install shell completion, run the command: | ||||
$ arc shell-complete | $ arc shell-complete | ||||
This will install shell completion into your current shell. After installing, | This will install shell completion into your current shell. After installing, | ||||
you may need to start a new shell (or open a new terminal window) to pick up | you may need to start a new shell (or open a new terminal window) to pick up | ||||
the updated configuration. | the updated configuration. | ||||
Once installed, completion should work across all Arcanist toolsets. | Once installed, completion should work across all toolsets. | ||||
**Using Completion** | **Using Completion** | ||||
After completion is installed, use the "tab" key to automatically complete | After completion is installed, use the "tab" key to automatically complete | ||||
workflows and flags. For example, if you type: | workflows and flags. For example, if you type: | ||||
$ arc diff --draf<tab> | $ arc diff --draf<tab> | ||||
...your shell should automatically expand the flag to: | ...your shell should automatically expand the flag to: | ||||
$ arc diff --draft | $ arc diff --draft | ||||
**Updating Completion** | **Updating Completion** | ||||
To update shell completion, run the same command: | To update shell completion, run the same command: | ||||
$ arc shell-complete | $ arc shell-complete | ||||
You can update shell completion without reinstalling it by running: | You can update shell completion without reinstalling it by running: | ||||
$ arc shell-complete --generate | $ arc shell-complete --generate | ||||
You may need to update shell completion if: | You may need to update shell completion if: | ||||
- you install new Arcanist toolsets; or | - you install new toolsets; or | ||||
- you move the Arcanist directory; or | - you move this software on disk; or | ||||
- you upgrade Arcanist and the new version fixes shell completion bugs. | - you upgrade this software and the new version fixes shell completion bugs. | ||||
EOTEXT | EOTEXT | ||||
); | ); | ||||
return $this->newWorkflowInformation() | return $this->newWorkflowInformation() | ||||
->setSynopsis(pht('Install shell completion.')) | ->setSynopsis(pht('Install shell completion.')) | ||||
->setHelp($help); | ->setHelp($help); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 600 Lines • Show Last 20 Lines |