/[wait]/cvs-head/script/sman
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 /cvs-head/script/sman

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

revision 10 by ulpfr, Fri Apr 28 15:40:52 2000 UTC revision 65 by laperla, Wed Jan 23 12:22:54 2002 UTC
# Line 1  Line 1 
1  #!/usr/local/perl5.005_56.Mar06/bin/perl -w  #!perl -w
2  ######################### -*- Mode: Cperl -*- #########################  #                              -*- Mode: Perl -*-
3  ##  # $Basename: sman $
4  ## $Basename: sman $  # $Revision: 1.14 $
5  ## $Revision: 1.8 $  # Author          : Ulrich Pfeifer
6  ##  # Created On      : Fri Aug 30 15:52:25 1996
7  ## Author           : Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
8  ## Created On       : Fri Aug 30 15:52:25 1996  # Last Modified On: Mon May  8 11:03:46 2000
9  ##  # Language        : CPerl
10  ## Last Modified By : Ulrich Pfeifer  #
11  ## Last Modified On : Sun May 30 17:48:53 1999  # (C) Copyright 1996-2000, Ulrich Pfeifer
12  ##  #
 ## Copyright (c) 1996-1997, Ulrich Pfeifer  
 ##  
 ##  
 ######################################################################  
13    
14  use strict;  use strict;
15    
16  use Term::ReadLine;  use Term::ReadLine;
17  use Getopt::Long;  use Getopt::Long;
18  use Fcntl;  use Fcntl qw(O_RDONLY);
19  use Config;  use Config;
20    
21  require WAIT::Config;  require WAIT::Config;
# Line 43  GetOptions(\%OPT, Line 39  GetOptions(\%OPT,
39             'table=s',             'table=s',
40             'filter=i',             'filter=i',
41             'max=i',             'max=i',
42             'pager:s') || die "Usage: ...\n";             'pager:s') || die "
43    Usage: $0
44              [--database database]
45              [--dir      dir     ]
46              [--table    table   ]
47              [--filter   integer ]
48              [--max      integer ]
49              [--pager    pager   ]
50    ";
51    
52  my $db = WAIT::Database->open(name      => $OPT{database},  my $db = WAIT::Database->open(name      => $OPT{database},
53                                mode      => O_RDONLY,                                mode      => O_RDONLY,
# Line 121  while (defined ($_ = &myreadline("$st> " Line 125  while (defined ($_ = &myreadline("$st> "
125      if ($@ ne '') {      if ($@ ne '') {
126        print $OUT "$_ => $query\n\$\@='$@'\n";        print $OUT "$_ => $query\n\$\@='$@'\n";
127      } elsif (ref($query)) {      } elsif (ref($query)) {
128        %hits = $query->execute();        %hits = $query->execute(top => $OPT{max}, picky => 1);
129        # the hash %hits has as keys document numbers and as values        # the hash %hits has as keys document numbers and as values
130        # quality figures. The doc numbers are not what we have as docid        # quality figures. The doc numbers are not what we have as docid
131        # to find the item in the access class, they are WAIT's private        # to find the item in the access class, they are WAIT's private
# Line 157  while (defined ($_ = &myreadline("$st> " Line 161  while (defined ($_ = &myreadline("$st> "
161    }    }
162    
163  } continue {  } continue {
164    # we don't do this since ANdreas Koenig does not think of it as feature    # we don't do this since Andreas Koenig does not think of it as feature
165    # $term->SetHistory(grep length($_)>4, $term->GetHistory)    # $term->SetHistory(grep length($_)>4, $term->GetHistory)
166  }  }
167    warn "Thank you for using sman\n";
168    
169    $tb->close;
170    $db->close;
171    
172  sub myreadline {  sub myreadline {
173    if (@ARGV) {    if (@ARGV) {

Legend:
Removed from v.10  
changed lines
  Added in v.65

  ViewVC Help
Powered by ViewVC 1.1.26