Skip to content

Commit

Permalink
Allow configuration of tipsfile path
Browse files Browse the repository at this point in the history
  • Loading branch information
formorer authored and Christian Hofstaedtler committed Dec 6, 2011
1 parent 2a798f2 commit 376af34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion grml-tips
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions grml-tips-tags
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 376af34

Please sign in to comment.