Allow configuration of tipsfile path
authorAlexander Wirt <formorer@grml.org>
Mon, 13 Jun 2011 14:37:47 +0000 (16:37 +0200)
committerChristian Hofstaedtler <ch@grml.org>
Tue, 6 Dec 2011 11:36:47 +0000 (12:36 +0100)
grml-tips
grml-tips-tags

index 8ba4df6..258c8c0 100755 (executable)
--- a/grml-tips
+++ b/grml-tips
@@ -39,6 +39,10 @@ Print this help and exit.
 
 Match on tags only instead of the whole tip 
 
+=item B<--tipsfile TIPSFILE>
+
+Use TIPSFILE instead of /usr/share/grml-tips/grml_tips
+
 =back
 
 =head1 EXAMPLES
@@ -75,10 +79,12 @@ my $grml_tips = '/usr/share/grml-tips/grml_tips';
 
 my $help;
 my $tagsonly;
+my $tipsfile; 
 
 my $result = GetOptions (
     "help" => \$help,
-    "tagsonly" => \$tagsonly
+    "tagsonly" => \$tagsonly,
+    "tipsfile=s" => \$grml_tips, 
 );
 
 my $pattern   = shift;
index c1cdd0d..1bb3920 100755 (executable)
@@ -7,8 +7,14 @@
 ################################################################################
 
 use strict;
+use Getopt::Long;
 
 my $grml_tips = '/usr/share/grml-tips/grml_tips';
+
+my $result = GetOptions (
+        "tipsfile=s" => \$grml_tips
+);
+
 open (my $fh, '<', $grml_tips) or die "Could not open $grml_tips: $!";
 
 my @tags;