Skip to content

Commit 9e31caf

Browse files
committed
docs: improve auto completion docs, rename phpcli to ahccli
1 parent 9dbab25 commit 9e31caf

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -493,37 +493,51 @@ Whenever an exception is caught by `Application::handle()`, it will show a beaut
493493

494494
### Autocompletion
495495

496-
Any console line apps that are built on top of **adhocore/cli** can entertain autocomplete of commands and options in zsh shell with oh-my-zsh.
496+
Any console applications that are built on top of **adhocore/cli** can entertain autocomplete of commands and options in zsh shell with oh-my-zsh.
497497

498-
All you have to do is add one line to the end of `~/.oh-my-zsh/custom/plugins/phpcli/phpcli.plugin.zsh`:
498+
All you have to do is add one line to the end of `~/.oh-my-zsh/custom/plugins/ahccli/ahccli.plugin.zsh`:
499499

500-
> `compdef _phpcli <appname>`
500+
> `compdef _ahccli <appname>`
501501
502-
Example: `compdef _phpcli phint` for [phint](https://github.com/adhocore/phint).
502+
Example: `compdef _ahccli phint` for [phint](https://github.com/adhocore/phint).
503503

504504
That is cumbersome to perform manually, here's a complete command you can copy/paste/run:
505505

506506
#### One time setup
507507

508508
```sh
509-
mkdir -p ~/.oh-my-zsh/custom/plugins/phpcli && cd ~/.oh-my-zsh/custom/plugins/phpcli
510-
[ -f ./phpcli.plugin.zsh ] || curl -sSLo ./phpcli.plugin.zsh https://raw.githubusercontent.com/adhocore/php-cli/master/phpcli.plugin.zsh
511-
chmod +x ./phpcli.plugin.zsh && cd -
509+
mkdir -p ~/.oh-my-zsh/custom/plugins/ahccli && cd ~/.oh-my-zsh/custom/plugins/ahccli
510+
511+
[ -f ./ahccli.plugin.zsh ] || curl -sSLo ./ahccli.plugin.zsh https://raw.githubusercontent.com/adhocore/php-cli/master/ahccli.plugin.zsh
512+
513+
chmod +x ./ahccli.plugin.zsh && cd -
514+
```
515+
516+
##### Load ahccli plugin
517+
518+
```sh
519+
# Open .zshrc
520+
nano ~/.zshrc
521+
522+
# locate plugins=(... ...) and add ahccli
523+
plugins=(git ... ... ahccli)
524+
525+
# ... then save it (Ctrl + O)
512526
```
513527

514528
#### Registering app
515529

516530
```sh
517531
# replace appname with real name eg: phint
518-
echo compdef _phpcli appname >> ~/.oh-my-zsh/custom/plugins/phpcli/phpcli.plugin.zsh
532+
echo compdef _ahccli appname >> ~/.oh-my-zsh/custom/plugins/ahccli/ahccli.plugin.zsh
519533
```
520534

521535
> Of course you can add multiple apps, just change appname in above command
522536
523537
Then either restart the shell or source the plugin like so:
524538

525539
```sh
526-
source ~/.oh-my-zsh/custom/plugins/phpcli/phpcli.plugin.zsh
540+
source ~/.oh-my-zsh/custom/plugins/ahccli/ahccli.plugin.zsh
527541
```
528542

529543
#### Trigger autocomplete
@@ -535,9 +549,9 @@ appname subcommand <tab> # autocompletes options for subcommand (phint init <tab
535549

536550
### Related
537551

538-
- [adhocore/phalcon-ext](https://github.com/adhocore/phalcon-ext) Phalcon extension using `adhocore/cli`
539-
- [adhocore/phint](https://github.com/adhocore/phint) PHP project scaffolding app using `adhocore/cli`
540-
- [adhocore/type-hinter](https://github.com/adhocore/php-type-hinter) Auto PHP7 typehinter tool using `adhocore/cli`
552+
- [adhocore/phalcon-ext](https://github.com/adhocore/phalcon-ext) &middot; Phalcon extension using `adhocore/cli`
553+
- [adhocore/phint](https://github.com/adhocore/phint) &middot; PHP project scaffolding app using `adhocore/cli`
554+
- [adhocore/type-hinter](https://github.com/adhocore/php-type-hinter) &middot; Auto PHP7 typehinter tool using `adhocore/cli`
541555

542556
### Contributors
543557

0 commit comments

Comments
 (0)