projects
/
grml-tips.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ab2a3b
)
Add a nice header for every tip
author
Alexander Wirt
<formorer@grml.org>
Mon, 13 Jun 2011 09:14:15 +0000
(11:14 +0200)
committer
Alexander Wirt
<formorer@grml.org>
Mon, 13 Jun 2011 13:30:34 +0000
(15:30 +0200)
grml-tips
patch
|
blob
|
history
diff --git
a/grml-tips
b/grml-tips
index
161bc9d
..
dfa7bd9
100755
(executable)
--- a/
grml-tips
+++ b/
grml-tips
@@
-87,13
+87,19
@@
if (! open (my $fh, '<', "$grml_tips")) {
} else {
my $tip = '';
+ my $tips_found = 0;
while (my $line = <$fh>) {
if ($line !~ /^-- $/) {
$tip .= $line;
} else {
+ $tips_found++;
if ( $tip =~ /$pattern/mi ) {
- $tip .= $line;
- push @tips, $tip;
+ #$tip .= $line;
+
+ my $header = "Grml Tip Number $tips_found\n";
+ my $line = "-" x (length($header) -1 ) . "\n\n";
+
+ push @tips, $header . $line . $tip . "\n";
$tip = '';
} else {
$tip = '';