[system] / trunk / webwork-modperl / bin / wwsh Repository:
ViewVC logotype

View of /trunk/webwork-modperl/bin/wwsh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 810 - (download) (annotate)
Tue Apr 22 20:49:31 2003 UTC (10 years ago) by sh002i
File size: 1028 byte(s)
added bin/wwsh - a rudimentary webwork shell which (currently) allows
access to CourseEnvironment and DB objects. This could be extended to
provide a full shell for the WeBWorK system. (Uses PSH.pm.)
-sam

    1 #!/usr/bin/env perl
    2 
    3 ################################################################################
    4 # WeBWorK mod_perl (c) 1995-2002 WeBWorK Team, Univeristy of Rochester
    5 # $Id: wwsh,v 1.1 2003-04-22 20:49:31 sh002i Exp $
    6 ################################################################################
    7 
    8 =head1 NAME
    9 
   10 wwdb - command-line interface to the WeBWorK libraries.
   11 
   12 =cut
   13 
   14 use strict;
   15 use warnings;
   16 use FindBin;
   17 use lib "$FindBin::Bin";
   18 use PSH;
   19 use lib "$FindBin::Bin/../lib";
   20 use WeBWorK::CourseEnvironment;
   21 use WeBWorK::DB;
   22 
   23 sub main(@) {
   24 	my ($course) = @_;
   25 	
   26 	unless ($ENV{WEBWORK_ROOT}) {
   27 		die "WEBWORK_ROOT not found in environment.\n";
   28 	}
   29 	
   30 	unless ($course) {
   31 		die "usage: $0 course\n";
   32 	}
   33 	
   34 	our $ce = WeBWorK::CourseEnvironment->new($ENV{WEBWORK_ROOT}, "", $course);
   35 	our $db = WeBWorK::DB->new($ce);
   36 	(undef) = $db; # placate warnings
   37 	
   38 	print <<'EOF';
   39 wwsh - The WeBWorK Shell
   40 Available objects: $ce (WeBWorK::CourseEnvironment)
   41                    $db (WeBWorK::DB)
   42 EOF
   43 	
   44 	PSH::prompt();
   45 }
   46 
   47 main(@ARGV);

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9