posaune
[kivitendo-erp.git] / scripts / create_tags_file.pl
1 #!/usr/bin/perl
2 #
3 ########################################################
4 #
5 # This script creates a 'tags' file in the style of ctags
6 # out of the SL/ modules.
7 # Tags file is usable in some editors (vim, joe, emacs, ...). 
8 # See your editors documentation for more information.
9 #
10 # (c) Udo Spallek, Aachen
11 # Licenced under GNU/GPL.
12 #
13 ########################################################
14
15 use Perl::Tags;
16 use IO::Dir;
17 use Data::Dumper;
18
19 use strict;
20 use warnings FATAL =>'all';
21 use diagnostics;
22
23 use Getopt::Long;
24
25 my $parse_SL         = 1;
26 my $parse_binmozilla = 0;
27 GetOptions("sl!"         => \$parse_SL,
28            "pm!"         => \$parse_SL,
29            "binmozilla!" => \$parse_binmozilla,
30            "pl!"         => \$parse_binmozilla,
31            );
32
33 my @files = ();
34 push @files, grep { /\.pm$/ && s{^}{SL/}gxms         } IO::Dir->new("SL/")->read()          if $parse_SL;
35 push @files, grep { /\.pl$/ && s{^}{bin/mozilla/}gxms} IO::Dir->new("bin/mozilla/")->read() if $parse_binmozilla;
36
37 #map { s{^}{SL\/}gxms } @files;
38
39 #print Dumper(@files);
40
41 #__END__
42 my $naive_tagger = Perl::Tags::Naive->new( max_level=>1 );
43 $naive_tagger->process(
44          files => [@files],
45          refresh=>1 
46 );
47
48 my $tagsfile="tags";
49
50 # of course, it may not even output, for example, if there's nothing new to process
51 $naive_tagger->output( outfile => $tagsfile );
52
53
54 1;