Exemplo n.º 1
0
 *
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 * that is available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
 * the PHP License and are unable to obtain it through the web, please
 * send a note to license@php.net so we can mail you a copy immediately.
 *
 * @author    Martin Jansen <*****@*****.**>
 * @copyright 2005 The PEAR Group
 * @version   CVS: $Id: make-partial.php 197121 2005-09-28 15:47:51Z techtonik $
 */
// NOTE: originally from peardoc:/make-partial.php ;
// these files should be kept in sync
if (substr(PHP_VERSION, 0, 1) == "4") {
    require_once "PHP/Compat.php";
    $components = PHP_Compat::loadVersion('5.0.0');
}
require_once "Console/Getopt.php";
$console = new Console_Getopt();
$args = $console->getopt($console->readPHPArgv(), array(), array("format=", "include=", "help"));
// {{{ gather arguments
$format = "html";
$sections = array();
$incflag = false;
foreach ($args[0] as $arg) {
    if ($arg[0] == "--help") {
        showHelp();
        exit(0);
    } elseif ($arg[0] == "--format") {
        $format = $arg[1];
    } elseif ($arg[0] == '--include') {