How to write cli command


#1

Hello, I would like to use hoa cli, but the documentation is a bit basic. So I would like to have a basic start, and from this I can complete a bit the documentation

Thanks


#2

Hello :-),

Do you want to write a CLI command for an Hoa library?


#3

No for a specific project


#4

Hoa\Cli is a framework to write CLI for Hoa’s libraries. If you write a library that fits Hoa’s conventions, then you can use Hoa\Cli, then you can develop it yourself. This is very basic. All it does is summed up in this file: https://github.com/hoaproject/Cli/blob/master/Bin/Hoa.php


#5

The idea is to write cli tools with several commands. I was hoping to use hoa cli (to try it) but if it’s for internal tools only let’s forget it.


#6

Then simply clone Cli/Bin/Hoa.php. It contains a router and a dispatcher. Everything else is like regular Hoa’s commands.


#7

thanks for the answer