From 376af346a589539af6f529756209b080d8094f49 Mon Sep 17 00:00:00 2001 From: Alexander Wirt Date: Mon, 13 Jun 2011 16:37:47 +0200 Subject: [PATCH] Allow configuration of tipsfile path --- grml-tips | 8 +++++++- grml-tips-tags | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/grml-tips b/grml-tips index 8ba4df6..258c8c0 100755 --- 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; diff --git a/grml-tips-tags b/grml-tips-tags index c1cdd0d..1bb3920 100755 --- a/grml-tips-tags +++ b/grml-tips-tags @@ -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; -- 2.1.4