From: Chris Hanson Date: Sat, 3 Jan 1998 18:12:52 +0000 (+0000) Subject: Implement command-line option to specify student directory. X-Git-Tag: 20090517-FFI~4905 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4fc842a7e825d9a46abaa457724524e98c9f7a19;p=mit-scheme.git Implement command-line option to specify student directory. --- diff --git a/v7/src/6001/edextra.scm b/v7/src/6001/edextra.scm index b90309736..cb8dfea26 100644 --- a/v7/src/6001/edextra.scm +++ b/v7/src/6001/edextra.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: edextra.scm,v 1.23 1997/12/23 05:16:15 cph Exp $ +$Id: edextra.scm,v 1.24 1998/01/03 18:12:52 cph Exp $ -Copyright (c) 1992-97 Massachusetts Institute of Technology +Copyright (c) 1992-98 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -40,6 +40,14 @@ MIT in each case. |# (define student-work-directory) (define pset-directory) (define pset-list-file) +(define command-line-student-directory #f) + +(set-command-line-parser! "-student" + (lambda (command-line) + (let ((name (cadr command-line))) + (if (file-directory? name) + (set! command-line-student-directory (->pathname name))) + (values (cddr command-line) #F)))) (set! standard-editor-initialization (let ((usual standard-editor-initialization)) @@ -49,11 +57,16 @@ MIT in each case. |# (define (standard-login-initialization) (set! student-root-directory - (let ((6001-dir (get-environment-variable "MITSCHEME_6001_DIRECTORY"))) - (if (and 6001-dir (file-directory? 6001-dir)) - (pathname-as-directory 6001-dir) - "~u6001/"))) - (set! student-work-directory "~/work/") + (if (and command-line-student-directory + (file-directory? command-line-student-directory)) + (pathname-as-directory command-line-student-directory) + (let ((6001-dir + (get-environment-variable "MITSCHEME_6001_DIRECTORY"))) + (if (and 6001-dir (file-directory? 6001-dir)) + (pathname-as-directory 6001-dir) + "~u6001/")))) + (set! student-work-directory + (merge-pathnames "work/" student-root-directory)) (if (not (file-directory? student-root-directory)) (set! student-root-directory (user-homedir-pathname))) (if (not (file-directory? student-work-directory))