Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/capmousse/jet-console
Simple package to build command line app
https://github.com/capmousse/jet-console
Last synced: 29 days ago
JSON representation
Simple package to build command line app
- Host: GitHub
- URL: https://github.com/capmousse/jet-console
- Owner: CapMousse
- License: mit
- Created: 2012-07-27T13:58:37.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-09-26T14:04:12.000Z (over 7 years ago)
- Last Synced: 2024-10-05T15:41:29.575Z (3 months ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Travis status](https://secure.travis-ci.org/CapMousse/Jet-Console.png)](http://travis-ci.org/#!/CapMousse/Jet-Console)
# Jet Console
> The Jet Console package help you to create simple, reliable and testable command line utilities for your application
> You can easily create command line elements for your taks, deployment and more.## Why ?
I created this simple console package to simplify the creation of command line app. It's not like Symfony Console component, it's more simple, faster and flexible.
## Installation
Just download the git repository and get and autoload. Or load file manually. But I realy recommand to get an autoload file (realy, it's just crazy to load all file manualy).
## How to use
To use this console package, you just need to create your command :
```php
setName('example')
->setDescription('An example command')
->addArgument('hello', Argument::OPTIONAL, null, 'description');
}public function execute()
{
if ($this->hasArgument('hello')) {
return $this->someMethod();
}$this->display('No argument found');
}public function someMethod()
{
$argument = $this->getArgument('hello');
$this->display("hello {$argument}");
}
}
```Now, to use your command, you need to create the file to run it (in a bin directory) ! (if you are a Windows user, remove the first line)
```php
#!/usr/bin/env php
addCommand(new ExampleCommand);
$console->run();```
Let's run !
```
bin/test example --hello you
```# Test
Just run `phpunit` or see the travis status
Feel free to contribute!
------------------------* Fork
* Report bug
* Help in development
* Buy me a new mac (what ?)Licence
-------Released under a [BSD license](http://en.wikipedia.org/wiki/BSD_licenses)