[system] / branches / gage_dev / webwork2 / bin / wwsh Repository:
ViewVC logotype

View of /branches/gage_dev/webwork2/bin/wwsh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4113 - (download) (annotate)
Wed May 31 01:07:25 2006 UTC (6 years, 11 months ago) by gage
Original Path: trunk/webwork2/bin/wwsh
File size: 1716 byte(s)
Roll back unwanted change to wwsh

    1 #!/usr/bin/env perl -d
    2 ################################################################################
    3 # WeBWorK Online Homework Delivery System
    4 # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/
    5 # $CVSHeader: webwork-modperl/bin/wwsh,v 1.8 2006/01/25 23:13:45 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 Data::Dumper;
   25 
   26 BEGIN {
   27 	DB::parse_options("NonStop=1");
   28 	unless ($ENV{WEBWORK_ROOT}) {
   29 		die "WEBWORK_ROOT not found in environment.\n";
   30 	}
   31 }
   32 
   33 use lib "$ENV{WEBWORK_ROOT}/lib";
   34 use WeBWorK::CourseEnvironment;
   35 use WeBWorK::DB;
   36 
   37 our $ce;
   38 our $db;
   39 
   40 my $courseID = shift @ARGV;
   41 unless ($courseID) {
   42 	die "usage: $0 courseID\n";
   43 }
   44 
   45 $ce = WeBWorK::CourseEnvironment->new({
   46 	webwork_dir => $ENV{WEBWORK_ROOT},
   47 	courseName => $courseID,
   48 });
   49 $db = WeBWorK::DB->new($ce->{dbLayout});
   50 
   51 print <<'EOF';
   52 wwsh - The WeBWorK Shell
   53 Available objects: $ce (WeBWorK::CourseEnvironment)
   54                    $db (WeBWorK::DB)
   55 Available modules: Data::Dumper
   56 EOF
   57 
   58 DB::parse_options("NonStop=0");

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9