X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=blobdiff_plain;f=bin%2Fcli.pl;h=b9c3733edb450c0ed7e81d343df04647b5a4108b;hp=b00088e08a069bd0c8841e1da999843835e10d9e;hb=c65d35f21aa8ffd43d5c993f710cd2d6c377591f;hpb=8ddfa88afea617dc8546f10313026d51fb79a926 diff --git a/bin/cli.pl b/bin/cli.pl index b00088e..b9c3733 100755 --- a/bin/cli.pl +++ b/bin/cli.pl @@ -14,19 +14,22 @@ use Getopt::Long; use Carp qw/confess/; my $debug = 0; -my $store_path = 'state.db'; +my $store_path = './'; +my $store_plugin = 'YAML'; GetOptions( 'debug+' => \$debug, 'store-path=s' => \$store_path, + 'store-plugin=s' => \$store_plugin, ); my $sh = Term::Shelly->new(); my $tree = CWMP::Tree->new({ debug => $debug }); our $store = CWMP::Store->new({ - debug => $debug, + module => $store_plugin, path => $store_path, + debug => $debug, }); $sh->out( @@ -77,7 +80,7 @@ sub completer { # do we have list (part) of CPE? if ( $line =~ /^(\S*)\s*$/ ) { - @matches = sort grep { /^\Q$curword\E/ } $store->known_CPE; + @matches = sort grep { /^\Q$curword\E/ } $store->all_uids; $sh->out( "CPE available: ", join(",", @matches ) ); } elsif ( $line =~ /^(\w+)\s+(\S+)$/ ) { $sh->out("finding completes for '$2'");