/[cwmp]/google/trunk/bin/cli.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/trunk/bin/cli.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 163 by dpavlin, Fri Oct 26 11:42:39 2007 UTC revision 164 by dpavlin, Sat Oct 27 23:06:09 2007 UTC
# Line 14  use Getopt::Long; Line 14  use Getopt::Long;
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(
# Line 77  sub completer { Line 80  sub completer {
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'");

Legend:
Removed from v.163  
changed lines
  Added in v.164

  ViewVC Help
Powered by ViewVC 1.1.26