Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/district09/php_package_command-builder

A generic shell command builder.
https://github.com/district09/php_package_command-builder

d09check22 web

Last synced: 3 days ago
JSON representation

A generic shell command builder.

Awesome Lists containing this project

README

        

# Command builder

## Code example

```php
addFlag('a')
->addFlag('l')
->pipeOutputTo('grep')
->addArgument('mydir')
->onSuccess('echo')
->addArgument('mydir already exists')
->onFailure(
CommandBuilder::create('mkdir')
->addArgument('mydir')
->onSuccess('echo')
->addArgument('mydir created')
);
print $builder;
```

### Output

```sh
{ { { ls -a -l | grep 'mydir'; } && echo 'mydir already exists'; } || { mkdir 'mydir' && echo 'mydir created'; }; }
```