2001-02-06 19:21:47 +00:00
|
|
|
<? // Preamble>
|
2011-12-11 09:19:48 +00:00
|
|
|
$program = addSlashes ($_REQUEST['program']);
|
2001-11-06 09:43:55 +00:00
|
|
|
$pageName = "Command Documentation for " . $program;
|
2007-03-18 04:34:44 +00:00
|
|
|
require "parts/preamble.php"; // Load most of document
|
2001-02-06 19:21:47 +00:00
|
|
|
|
|
|
|
have ('cmd');
|
|
|
|
|
|
|
|
function printRow ($name, $description)
|
|
|
|
{
|
2001-11-06 09:43:55 +00:00
|
|
|
echo '<TR vAlign="top"><TD>' . $name . '</TD><TD>' . $description . '</TD></TR>';
|
2001-02-06 19:21:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function printArray ($cmd_list, $program)
|
|
|
|
{
|
|
|
|
tableBoxHeader ('black', tableHeadColor);
|
|
|
|
tableTitle ("cmds available in " . $program, 2, tableHeadColor);
|
|
|
|
|
|
|
|
printRow ('name', 'description');
|
|
|
|
|
|
|
|
$description = '';
|
|
|
|
while (list (, $cmd) = each ($cmd_list)) {
|
|
|
|
$pos = strpos ($cmd, ' :');
|
|
|
|
if ($pos > 0) {
|
|
|
|
if ($description) {
|
|
|
|
printRow ($name, $description);
|
|
|
|
$description = '';
|
|
|
|
}
|
|
|
|
$name = trim (substr ($cmd, 0, $pos - 1));
|
|
|
|
} else {
|
|
|
|
if ($description) {
|
|
|
|
$description = $description . '<BR>' . trim ($cmd);
|
|
|
|
} else {
|
|
|
|
$description = trim ($cmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($description) {
|
|
|
|
printRow ($name, $description);
|
|
|
|
$description = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
tableBoxFooter ();
|
|
|
|
}
|
|
|
|
|
|
|
|
function printCmdlist ($program)
|
|
|
|
{
|
|
|
|
$cmd_list = file ('doc/' . $program . '-cmd.txt');
|
|
|
|
printArray ($cmd_list, $program);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strchr ($program, '.') || strchr ($program, '/') || !is_file ('doc/' . $program . '-cmd.txt')) {
|
|
|
|
echo 'no such program.';
|
|
|
|
} else {
|
|
|
|
printCmdlist ($program);
|
|
|
|
}
|
|
|
|
?>
|