14 |
use Carp qw/confess/; |
use Carp qw/confess/; |
15 |
|
|
16 |
my $debug = 0; |
my $debug = 0; |
17 |
my $store_path = 'state.db'; |
my $store_path = './'; |
18 |
|
my $store_plugin = 'YAML'; |
19 |
|
|
20 |
GetOptions( |
GetOptions( |
21 |
'debug+' => \$debug, |
'debug+' => \$debug, |
22 |
'store-path=s' => \$store_path, |
'store-path=s' => \$store_path, |
23 |
|
'store-plugin=s' => \$store_plugin, |
24 |
); |
); |
25 |
|
|
26 |
my $sh = Term::Shelly->new(); |
my $sh = Term::Shelly->new(); |
27 |
my $tree = CWMP::Tree->new({ debug => $debug }); |
my $tree = CWMP::Tree->new({ debug => $debug }); |
28 |
|
|
29 |
our $store = CWMP::Store->new({ |
our $store = CWMP::Store->new({ |
30 |
debug => $debug, |
module => $store_plugin, |
31 |
path => $store_path, |
path => $store_path, |
32 |
|
debug => $debug, |
33 |
}); |
}); |
34 |
|
|
35 |
$sh->out( |
$sh->out( |
80 |
|
|
81 |
# do we have list (part) of CPE? |
# do we have list (part) of CPE? |
82 |
if ( $line =~ /^(\S*)\s*$/ ) { |
if ( $line =~ /^(\S*)\s*$/ ) { |
83 |
@matches = sort grep { /^\Q$curword\E/ } $store->known_CPE; |
@matches = sort grep { /^\Q$curword\E/ } $store->all_uids; |
84 |
$sh->out( "CPE available: ", join(",", @matches ) ); |
$sh->out( "CPE available: ", join(",", @matches ) ); |
85 |
} elsif ( $line =~ /^(\w+)\s+(\S+)$/ ) { |
} elsif ( $line =~ /^(\w+)\s+(\S+)$/ ) { |
86 |
$sh->out("finding completes for '$2'"); |
$sh->out("finding completes for '$2'"); |