-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
executable file
·36 lines (28 loc) · 1.03 KB
/
Copy pathexample.php
File metadata and controls
executable file
·36 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /usr/bin/env hhvm
<?hh
// Find the composer autoloader
$basedir = __DIR__;
do {
if(file_exists($basedir . '/composer.json') && file_exists($basedir . '/vendor/autoload.php')){
require_once($basedir . '/vendor/autoload.php');
break;
}
$basedir = dirname($basedir);
if($basedir === '/'){
die('You need to set up the project dependencies using the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL);
}
} while(true);
use kilahm\Clio\Clio;
$clio = Clio::fromCli();
$clio
->arg('arg1')
->arg('arg2')->describedAs('The second argument')
->opt('a')->describedAs(str_repeat('This is a really long description. ', 10))
->opt('long-option')->withValue()
->opt('another-option')->describedAs('That one option that does nothing.');
$clio->parseInput();
//$clio->help();
$answer = $clio->ask('Is this a question?')->withAnswers(Vector{'yes', 'no'})->getAnswer();
echo PHP_EOL . $answer;