script/find-concept.pl untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 34 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2  
3 use WWW::FindConcept;
4 use Getopt::Std;
5  
6 if(!@ARGV){
7 print <<".";
8 $0 queries find concepts
9 $0 -u queries update concepts in cache
10 $0 -r remove cache
11 $0 -d dump out cache
12 .
13 }
14 getopt('ur', \%opts);
15  
16  
17 if(exists $opts{r}){
18 print "Cache is removed.\n" if remove_cache;
19 exit;
20 }
21 elsif(exists $opts{d}){
22 print map{$_.$/} sort(dump_cache());
23 exit;
24 }
25  
26 unshift @ARGV, $opts{u} if defined $opts{u};
27 foreach my $query (@ARGV){
28 print "<$query>\n";
29 print
30 map{" $_\n"}
31 sort(
32 exists ($opts{u}) ?
33 update_concept($query) : find_concept($query)
34 );
35 }