Author: mcbrown
Date: 2008-01-29 13:36:32 +0100 (Tue, 29 Jan 2008)
New Revision: 9653
Log:
Adding support for --types=[xmltagtypes]
You can now select to only show a tree involving certain tag types, so:
idtree.pl --types=chapter,section storage-engines
Only shows chapter and section tags/IDs
If not specified, it shows all tag/ID types
Modified:
trunk/tools/idtree.pl
Modified: trunk/tools/idtree.pl
===================================================================
--- trunk/tools/idtree.pl 2008-01-29 10:26:32 UTC (rev 9652)
+++ trunk/tools/idtree.pl 2008-01-29 12:36:32 UTC (rev 9653)
Changed blocks: 2, Lines Added: 16, Lines Deleted: 2; 1202 bytes
@@ -24,14 +24,23 @@
use Getopt::Long;
use Data::Dumper;
-my ($srcpathopt,$opt_showallchildren,$opt_version,$opt_showtitles) = ('',0,undef,0);
+my ($srcpathopt,$opt_showallchildren,$opt_version,$opt_showtitles,$opt_types) = ('',0,undef,0,"");
my @srcpaths = ();
GetOptions("srcpaths=s" => \$srcpathopt,
"showallchildren" => \$opt_showallchildren,
"showtitles" => \$opt_showtitles,
- "prefix=s" => \$opt_version);
+ "prefix=s" => \$opt_version,
+ "types=s" => \$opt_types,
+ );
+my $showtypes = 0;
+my $onlytypes = {};
+if (my @typeslist = split(/,/,$opt_types))
+{
+ $showtypes = 1;
+ map { $onlytypes->{$_} = 1 } @typeslist;
+}
my $toprootid = $ARGV[0];
@@ -57,6 +66,11 @@
return if ($depth > 10);
+# print STDERR "$idmap->{byid}->{$id}->{type}\n";
+
+ return if ($showtypes == 1 &&
+ !exists($onlytypes->{$idmap->{byid}->{$id}->{type}}));
+
if ($opt_showallchildren == 0)
{
if ($opt_showtitles)
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r9653 - trunk/tools | mcbrown | 29 Jan |