Skip to content

Commit 10bc99f

Browse files
committed
Be more verbose.
1 parent 8031960 commit 10bc99f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

make-command-xml.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
* Outputs the XML to stdout.
55
*/
66

7+
echo "Starting the XML generation process\n\n";
8+
79
// Name of the command, eg 'Remote' for Remote.php's XML output
810
$dir = 'PEAR/Command/';
911
foreach (scandir($dir) as $file) {
1012
$file = explode('.', $file);
1113
if (isset($file[1]) && $file[1] === 'php' && $file[0] != 'Common') {
14+
echo "Generating XML for " . $file[0] . " \n";
1215
generateXML($file[0]);
1316
}
1417
}
1518

19+
echo "\nDone.\n";
20+
1621
function generateXML($name)
1722
{
1823
$file = 'PEAR/Command/' . $name . '.php';
@@ -39,7 +44,12 @@ function generateXML($name)
3944
foreach($docs['options'] as $option => $opt_docs) {
4045
$option = htmlentities($option, ENT_QUOTES, 'UTF-8', false);
4146
$xml .= ' <'.$option.'>'."\n";
42-
$xml .= ' <shortopt>'.htmlentities($opt_docs['shortopt'], ENT_QUOTES, 'UTF-8', false)."</shortopt>\n";
47+
$xml .= ' <shortopt>';
48+
if (isset($opt_docs['shortopt'])) {
49+
$xml .= htmlentities($opt_docs['shortopt'], ENT_QUOTES, 'UTF-8', false);
50+
}
51+
52+
$xml .= "</shortopt>\n";
4353
$xml .= ' <doc>'.htmlentities($opt_docs['doc'], ENT_QUOTES, 'UTF-8', false)."</doc>\n";
4454
if (isset($opt_docs['arg']) && $opt_docs['arg'] != '') {
4555
$xml .= ' <arg>'.htmlentities($opt_docs['arg'], ENT_QUOTES, 'UTF-8', false)."</arg>\n";

0 commit comments

Comments
 (0)