Parent Directory
|
Revision Log
Revision 5319 - (view) (download)
| 1 : | sh002i | 3771 | #!/usr/bin/env perl -d |
| 2 : | sh002i | 810 | ################################################################################ |
| 3 : | sh002i | 1663 | # WeBWorK Online Homework Delivery System |
| 4 : | sh002i | 5319 | # Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ |
| 5 : | # $CVSHeader: webwork2/bin/wwsh,v 1.10 2006/05/31 01:07:25 gage Exp $ | ||
| 6 : | sh002i | 1663 | # |
| 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 : | sh002i | 810 | ################################################################################ |
| 17 : | |||
| 18 : | =head1 NAME | ||
| 19 : | |||
| 20 : | wwdb - command-line interface to the WeBWorK libraries. | ||
| 21 : | |||
| 22 : | =cut | ||
| 23 : | |||
| 24 : | sh002i | 3771 | use Data::Dumper; |
| 25 : | sh002i | 2819 | |
| 26 : | BEGIN { | ||
| 27 : | sh002i | 3771 | DB::parse_options("NonStop=1"); |
| 28 : | unless ($ENV{WEBWORK_ROOT}) { | ||
| 29 : | die "WEBWORK_ROOT not found in environment.\n"; | ||
| 30 : | } | ||
| 31 : | sh002i | 2819 | } |
| 32 : | |||
| 33 : | gage | 4113 | use lib "$ENV{WEBWORK_ROOT}/lib"; |
| 34 : | use WeBWorK::CourseEnvironment; | ||
| 35 : | use WeBWorK::DB; | ||
| 36 : | sh002i | 810 | |
| 37 : | sh002i | 3771 | our $ce; |
| 38 : | our $db; | ||
| 39 : | sh002i | 2819 | |
| 40 : | sh002i | 3771 | my $courseID = shift @ARGV; |
| 41 : | unless ($courseID) { | ||
| 42 : | die "usage: $0 courseID\n"; | ||
| 43 : | sh002i | 2819 | } |
| 44 : | |||
| 45 : | sh002i | 3771 | $ce = WeBWorK::CourseEnvironment->new({ |
| 46 : | webwork_dir => $ENV{WEBWORK_ROOT}, | ||
| 47 : | courseName => $courseID, | ||
| 48 : | }); | ||
| 49 : | $db = WeBWorK::DB->new($ce->{dbLayout}); | ||
| 50 : | sh002i | 2819 | |
| 51 : | sh002i | 3771 | print <<'EOF'; |
| 52 : | sh002i | 810 | wwsh - The WeBWorK Shell |
| 53 : | Available objects: $ce (WeBWorK::CourseEnvironment) | ||
| 54 : | $db (WeBWorK::DB) | ||
| 55 : | sh002i | 3771 | Available modules: Data::Dumper |
| 56 : | sh002i | 810 | EOF |
| 57 : | sh002i | 3771 | |
| 58 : | DB::parse_options("NonStop=0"); |
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |