;;; The scsh argv switch parser. ;;; Copyright (c) 1995 by Olin Shivers. See file COPYING. ;;; Imports: ;;; COMMAND-PROCESSOR: set-batch-mode?! command-loop ;;; ENSURES-LOADED: really-ensure-loaded ;;; ENVIRONMENTS: set-interaction-environment! environment-ref ;;; environment-define! ;;; ERROR-PACKAGE: error ;;; EVALUATION: eval ;;; EXTENDED-PORTS: make-string-input-port ;;; INTERFACES: make-simple-interface ;;; INTERRUPTS: interrupt-before-heap-overflow! ;;; PACKAGE-COMMANDS-INTERNAL: user-environment config-package ;;; get-reflective-tower ;;; PACKAGE-MUTATION: package-open! ;;; PACKAGES: structure-package structure? make-structure ;;; make-simple-package ;;; RECEIVING: mv return stuff ;;; SCSH-LEVEL-0-INTERNALS: set-command-line-args! ;;; SCSH-VERSION: scsh-version-string ;;; ;;; This should be defined by the package code, but it isn't. (define (get-struct config-pack struct-name) (let ((s (environment-ref config-pack struct-name))) (cond ((structure? s) s) (else (error "not a structure" s struct-name))))) ;;; The switches: ;;; -o Open the structure in current package. ;;; -n Create new package, make it current package. ;;; -m 's package becomes current package. ;;; ;;; -l Load into current package. ;;; -lm Load into config package. ;;; ;;; These two require a terminating -s or -sfd arg: ;;; -ds Load terminating script into current package. ;;; -dm Load terminating script into config package. ;;; ;;; -e Call () to start program. ;;; ;;; Terminating switches: ;;; -c Eval , then exit. ;;; -s