Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
#!/usr/bin/php
2
<?php
3
/**
4
 * This is an example with Console_Getoptplus::getopt2()
5
 *
6
 * Examples to run on the command line:
7
 * #getopt2 --foo -b car -c
8
 * #getopt2 --bar car param1 param2
9
 */
10
 
11
require_once 'Console/GetoptPlus.php';
12
 
13
try {
14
    $shortOptions = 'b:c::';
15
    $longOptions = array('foo', 'bar=');
16
 
17
    $args = Console_Getoptplus::readPHPArgv();
18
    array_shift($args);
19
    $options = Console_Getoptplus::getopt2($args, $shortOptions, $longOptions);
20
    print_r($options);
21
}
22
catch(Console_GetoptPlus_Exception $e) {
23
    $error = array($e->getCode(), $e->getMessage());
24
    print_r($error);
25
}
26
 
27
?>