Parent Directory
|
Revision Log
This commit was manufactured by cvs2svn to create branch 'rel-2-1-patches'.
1 #!/usr/bin/env perl 2 ################################################################################ 3 # WeBWorK Online Homework Delivery System 4 # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ 5 # $CVSHeader: webwork2/bin/wwsh,v 1.5 2004/01/03 21:00:28 sh002i Exp $ 6 # 7 # This program is free software; you can redistribute it and/or modify it under 8 # the terms of either: (a) the GNU General Public License as published by the 9 # Free Software Foundation; either version 2, or (at your option) any later 10 # version, or (b) the "Artistic License" which comes with this package. 11 # 12 # This program is distributed in the hope that it will be useful, but WITHOUT 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 14 # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the 15 # Artistic License for more details. 16 ################################################################################ 17 18 =head1 NAME 19 20 wwdb - command-line interface to the WeBWorK libraries. 21 22 =cut 23 24 use strict; 25 use warnings; 26 27 BEGIN { 28 die "WEBWORK_ROOT not found in environment.\n" 29 unless exists $ENV{WEBWORK_ROOT}; 30 } 31 32 use lib "$ENV{WEBWORK_ROOT}/lib"; 33 use PSH; 34 use WeBWorK::CourseEnvironment; 35 use WeBWorK::DB; 36 37 my ($course, $cmd) = @ARGV; 38 39 unless ($course) { 40 die "usage: $0 course\n"; 41 } 42 43 our $ce = WeBWorK::CourseEnvironment->new($ENV{WEBWORK_ROOT}, "", "", $course); 44 our $db = WeBWorK::DB->new($ce->{dbLayout}); 45 (undef) = $db; # placate warnings 46 47 if ($cmd) { 48 no warnings; 49 no strict; 50 eval $cmd; 51 die $@ if $@; 52 use strict; 53 use warnings; 54 } else { 55 print <<'EOF'; 56 wwsh - The WeBWorK Shell 57 Available objects: $ce (WeBWorK::CourseEnvironment) 58 $db (WeBWorK::DB) 59 EOF 60 PSH::prompt(); 61 }
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |