-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathspellbook.pl
More file actions
executable file
·41 lines (31 loc) · 764 Bytes
/
spellbook.pl
File metadata and controls
executable file
·41 lines (31 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env perl
use 5.030;
use strict;
use warnings;
use Find::Lib './lib';
use Spellbook::Core::Helper;
use Spellbook::Core::Search;
use Spellbook::Core::Module;
use Getopt::Long qw(:config no_ignore_case pass_through);
our $VERSION = '0.0.1';
sub main {
my ($search, $module, @result);
Getopt::Long::GetOptions (
's|search=s' => \$search,
'm|module=s' => \$module
);
if ($search) {
@result = Spellbook::Core::Search -> new($search);
}
if ($module) {
@result = Spellbook::Core::Module -> new($module, \@ARGV);
}
foreach my $item (@result) {
print $item, "\n";
}
if (!$search && !$module) {
return Spellbook::Core::Helper -> new();
}
return 0;
}
main();