-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.php
50 lines (43 loc) · 1.32 KB
/
run.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* @author: stev leibelt <artodeto@bazzline.net>
* @since: 2015-04-16
*/
use Net\Bazzline\Component\Cli\Arguments\Arguments;
require_once __DIR__ . '/../vendor/autoload.php';
$arguments = new Arguments($argv);
if ($arguments->hasArguments()) {
echo $arguments->getNumberOfArguments() . ' arguments provided:' . PHP_EOL;
foreach ($arguments->getArguments() as $argument) {
echo ' ' . $argument . PHP_EOL;
}
} else {
echo 'no values provided' . PHP_EOL;
}
if ($arguments->hasLists()) {
echo $arguments->getNumberOfLists() . ' lists provided:' . PHP_EOL;
foreach ($arguments->getLists() as $name => $values) {
echo ' ' . $name . PHP_EOL;
foreach ($values as $value) {
echo ' ' . $value . PHP_EOL;
}
}
} else {
echo 'no values provided' . PHP_EOL;
}
if ($arguments->hasFlags()) {
echo $arguments->getNumberOfFlags() . ' flags provided:' . PHP_EOL;
foreach ($arguments->getFlags() as $flag) {
echo ' ' . $flag . PHP_EOL;
}
} else {
echo 'no flags provided' . PHP_EOL;
}
if ($arguments->hasValues()) {
echo $arguments->getNumberOfValues() . ' values provided:' . PHP_EOL;
foreach ($arguments->getValues() as $value) {
echo ' ' . $value . PHP_EOL;
}
} else {
echo 'no values provided' . PHP_EOL;
}