author | wenzelm |
Wed, 21 Nov 2012 15:50:54 +0100 | |
changeset 50149 | aaf276a28551 |
parent 48858 | 86816c61b5ca |
permissions | -rw-r--r-- |
42077
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
1 |
# |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
2 |
# Author: Makarius |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
3 |
# |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
4 |
# tools.pl - list Isabelle tools with description |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
5 |
# |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
6 |
|
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
7 |
use strict; |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
8 |
use warnings; |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
9 |
|
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
10 |
my @tools = (); |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
11 |
|
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
12 |
for my $dir (split(":", $ENV{"ISABELLE_TOOLS"})) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
13 |
if (-d $dir) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
14 |
if (opendir DIR, $dir) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
15 |
for my $name (readdir DIR) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
16 |
my $file = "$dir/$name"; |
42124 | 17 |
if (-f $file and -x $file and !($file =~ /~$/ or $file =~ /\.orig$/)) { |
42077
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
18 |
if (open FILE, $file) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
19 |
my $description; |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
20 |
while (<FILE>) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
21 |
if (!defined($description) and m/DESCRIPTION: *(.*)$/) { |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
22 |
$description = $1; |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
23 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
24 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
25 |
close FILE; |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
26 |
if (defined($description)) { |
48858 | 27 |
push(@tools, " $name - $description\n"); |
42077
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
28 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
29 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
30 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
31 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
32 |
closedir DIR; |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
33 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
34 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
35 |
} |
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
36 |
|
96c50a4210a2
list Isabelle tools via perl script, which is much faster that bash plumbing, especially on Cygwin;
wenzelm
parents:
diff
changeset
|
37 |
for (sort @tools) { print }; |