From 94ddd3c0440a78b1c66b41863bfb19343976b49d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 25 Oct 2007 04:41:17 -0400 Subject: [PATCH] topics! --- fanboy | 20 +++++++++++++++----- filters.6 | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/fanboy b/fanboy index 32fe7e3..c685ed0 100755 --- a/fanboy +++ b/fanboy @@ -1,11 +1,21 @@ #!/usr/bin/perl +my %topics=( + git => [qw(linus git linux rebase rebased merge merged cherry-pick + branch branched branches git-*)], + ubuntu => [qw(Mark MOTU ubuntu debian rock rocks rule naked dapper + feisty fiesty gutsy hoary edgy universe launchpad gnome desktop + sabdfl)], +); + if (! @ARGV) { - @ARGV=qw(linus git linux rebase rebased merge merged cherry-pick - branch branched branches git-*); + @ARGV=@{$topics{git}}; +} +elsif (@ARGV == 1 && exists $topics{$ARGV[0]}) { + @ARGV=@{$topics{$ARGV[0]}}; } -my $coolstuff=join("|", +my $total_awesomeness_dude=join("|", map { $_=quotemeta($_); s/\\\*/.*/g; @@ -17,7 +27,7 @@ my $len=0; my $indent=""; my $indent_printed=0; while () { - if (/$coolstuff/) { + if (/$total_awesomeness_dude/) { if (/^([>|][>|\s]*)/) { if ($indent ne $1) { print "\n" if $len; @@ -35,7 +45,7 @@ while () { $indent_printed=0; } - while(/(($coolstuff)[.?!]*)/ig) { + while(/(($total_awesomeness_dude)[.?!]*)/ig) { $len+=length($1)+1; if ($len > 70) { print "\n"; diff --git a/filters.6 b/filters.6 index 3d9e13a..647b982 100644 --- a/filters.6 +++ b/filters.6 @@ -27,7 +27,8 @@ K3wl hacker slang .IP fanboy Speak like a fanboy. By default, it will speak like a fan of git/Linus/linux development. To change this, pass as parameters the words that the fanboy -typically uses. +typically uses. Alternatively, pass the name of a topic that typically has +fanboys to use a predefined word list. .IP fudd Elmer Fudd .IP jethro -- 2.30.2