lib/scripts/tools.pl
author wenzelm
Sat, 05 Apr 2014 15:03:40 +0200
changeset 56421 1ffd7eaa778b
parent 48858 86816c61b5ca
permissions -rw-r--r--
updated to jedit_build-20140405: Code2HTML.jar, CommonControls.jar, Console.jar, kappalayout.jar, Navigator.jar, SideKick.jar, doc with jEdit manuals (ant dist-manuals);

#
# Author: Makarius
#
# tools.pl - list Isabelle tools with description
#

use strict;
use warnings;

my @tools = ();

for my $dir (split(":", $ENV{"ISABELLE_TOOLS"})) {
  if (-d $dir) {
    if (opendir DIR, $dir) {
      for my $name (readdir DIR) {
        my $file = "$dir/$name";
        if (-f $file and -x $file and !($file =~ /~$/ or $file =~ /\.orig$/)) {
          if (open FILE, $file) {
            my $description;
            while (<FILE>) {
              if (!defined($description) and m/DESCRIPTION: *(.*)$/) {
                $description = $1;
              }
            }
            close FILE;
            if (defined($description)) {
              push(@tools, "  $name - $description\n");
            }
          }
        }
      }
      closedir DIR;
    }
  }
}

for (sort @tools) { print };