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::getopt()
5
 *
6
 * Examples to run on the command line:
7
 * #getopt --foo -b car -c
8
 * #getopt --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
    $options = Console_Getoptplus::getopt($args, $shortOptions, $longOptions);
19
    print_r($options);
20
}
21
catch(Console_GetoptPlus_Exception $e) {
22
    $error = array($e->getCode(), $e->getMessage());
23
    print_r($error);
24
}
25
 
26
?>