/[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 97 by dpavlin, Sun Jun 24 16:32:48 2007 UTC revision 99 by dpavlin, Sun Jun 24 17:41:55 2007 UTC
# Line 59  $sh->{'mappings'}->{'down-history'} = [ Line 59  $sh->{'mappings'}->{'down-history'} = [
59          $self->fix_inputline;          $self->fix_inputline;
60  } ];  } ];
61    
62  my $state = 'CPE';  $sh->prompt( '> ' );
   
 $sh->prompt( $state . '> ' );  
63    
64  while (1) {  while (1) {
65          $sh->do_one_loop();          $sh->do_one_loop();
# Line 74  sub completer { Line 72  sub completer {
72    
73          my @matches;          my @matches;
74    
75          if ( $state eq 'CPE' ) {          # do we have list (part) of CPE?
76            if ( $line =~ /^(\w+)\s*$/ ) {
77                  @matches = sort grep { /^\Q$curword\E/ } $store->known_CPE;                  @matches = sort grep { /^\Q$curword\E/ } $store->known_CPE;
78                  $sh->out( "CPE available: ", join(",", @matches ) );                  $sh->out( "CPE available: ", join(",", @matches ) );
79          }          } elsif ( $line =~
80    
81          return @matches;          return @matches;
82  }  }

Legend:
Removed from v.97  
changed lines
  Added in v.99

  ViewVC Help
Powered by ViewVC 1.1.26