Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/district09/php_package_command-builder
- Owner: district09
- License: mit
- Created: 2018-06-22T09:01:41.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2022-09-07T10:53:15.000Z (over 2 years ago)
- Last Synced: 2024-11-05T09:52:23.199Z (about 2 months ago)
- Topics: d09check22, web
- Language: PHP
- Size: 24.4 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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'; }; }
```