File: shelldoc

package info (click to toggle)
shoop 0.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 328 kB
  • ctags: 41
  • sloc: sh: 1,138; makefile: 209; perl: 44
file content (32 lines) | stat: -rwxr-xr-x 639 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl
#
# This is a perl script that can strip unneeded characters from a
# shell script, so that certain shells(bash!) can run it faster.
#
# Copyright 2000 by Adam Heath <doogie@debian.org>
# Licensed under the LGPL
#

use Text::Wrap;

print "=head1 $ARGV[0]\n\n";
print "=over\n\n";
for($a = 1; $a < @ARGV; $a++) {
	open(FILE, "<" . $ARGV[$a]);
	while(<FILE>) {
		next if(! /^## /);
		s/^## //;
		$line .= $_;
	}
	if(defined $line) {
		$file = $ARGV[$a];
		$file =~ s/.sh$//;
		$file =~ s/.*\///;
		print "=item $file\n\n$line\n";
		undef $line;
	} else {
		print STDERR $ARGV[$a] . "\n";
	}
	close FILE;
}
print "=back\n\n";