@@ -493,37 +493,51 @@ Whenever an exception is caught by `Application::handle()`, it will show a beaut
493
493
494
494
### Autocompletion
495
495
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.
497
497
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 ` :
499
499
500
- > ` compdef _phpcli <appname> `
500
+ > ` compdef _ahccli <appname> `
501
501
502
- Example: ` compdef _phpcli phint ` for [ phint] ( https://github.com/adhocore/phint ) .
502
+ Example: ` compdef _ahccli phint ` for [ phint] ( https://github.com/adhocore/phint ) .
503
503
504
504
That is cumbersome to perform manually, here's a complete command you can copy/paste/run:
505
505
506
506
#### One time setup
507
507
508
508
``` 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)
512
526
```
513
527
514
528
#### Registering app
515
529
516
530
``` sh
517
531
# 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
519
533
```
520
534
521
535
> Of course you can add multiple apps, just change appname in above command
522
536
523
537
Then either restart the shell or source the plugin like so:
524
538
525
539
``` sh
526
- source ~ /.oh-my-zsh/custom/plugins/phpcli/phpcli .plugin.zsh
540
+ source ~ /.oh-my-zsh/custom/plugins/ahccli/ahccli .plugin.zsh
527
541
```
528
542
529
543
#### Trigger autocomplete
@@ -535,9 +549,9 @@ appname subcommand <tab> # autocompletes options for subcommand (phint init <tab
535
549
536
550
### Related
537
551
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 `
541
555
542
556
### Contributors
543
557
0 commit comments