forked from openwebwork/webwork2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwwsh
executable file
·59 lines (47 loc) · 1.67 KB
/
wwsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/perl -d
################################################################################
# WeBWorK Online Homework Delivery System
# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
# $CVSHeader: webwork2/bin/wwsh,v 1.10 2006/05/31 01:07:25 gage Exp $
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of either: (a) the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any later
# version, or (b) the "Artistic License" which comes with this package.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the
# Artistic License for more details.
################################################################################
=head1 NAME
wwdb - command-line interface to the WeBWorK libraries.
=cut
BEGIN {
DB::parse_options("NonStop=1");
unless ($ENV{WEBWORK_ROOT}) {
die "WEBWORK_ROOT not found in environment.\n";
}
}
use lib "$ENV{WEBWORK_ROOT}/lib";
use WeBWorK::CourseEnvironment;
use WeBWorK::DB;
use Data::Dumper;
our $ce;
our $db;
my $courseID = shift @ARGV;
unless ($courseID) {
die "usage: $0 courseID\n";
}
$ce = WeBWorK::CourseEnvironment->new({
webwork_dir => $ENV{WEBWORK_ROOT},
courseName => $courseID,
});
$db = WeBWorK::DB->new($ce->{dbLayout});
print <<'EOF';
wwsh - The WeBWorK Shell
Available objects: $ce (WeBWorK::CourseEnvironment)
$db (WeBWorK::DB)
Available modules: Data::Dumper
EOF
DB::parse_options("NonStop=0");