-s<num> is now -sfd <num> -- more consistent with general switch design.
This commit is contained in:
parent
47c2eea2dd
commit
2f7c39be3f
2
NEWS
2
NEWS
|
@ -13,6 +13,8 @@ Recent changes to the Scheme Shell.
|
||||||
Name-consistency change (non-backwards compatible):
|
Name-consistency change (non-backwards compatible):
|
||||||
open/nonblocking renamed to open/non-blocking,
|
open/nonblocking renamed to open/non-blocking,
|
||||||
which is the way it was always described in the manual.
|
which is the way it was always described in the manual.
|
||||||
|
-s<num> is now -sfd <num> -- more consistent with general switch
|
||||||
|
design.
|
||||||
|
|
||||||
11/03/96 (version 0.4.4)
|
11/03/96 (version 0.4.4)
|
||||||
minor fixes for SunOS, Solaris, AIX, NeXTStep, 686 systems
|
minor fixes for SunOS, Solaris, AIX, NeXTStep, 686 systems
|
||||||
|
|
2
RELEASE
2
RELEASE
|
@ -160,7 +160,7 @@ We even have one of those URL things:
|
||||||
** New meta-arg second-line syntax
|
** New meta-arg second-line syntax
|
||||||
Simpler grammar.
|
Simpler grammar.
|
||||||
|
|
||||||
** New -s<fdes> command line switch
|
** New -sfd <fdes> command line switch
|
||||||
Scripts can be read from stdin or other open file descriptors.
|
Scripts can be read from stdin or other open file descriptors.
|
||||||
|
|
||||||
** Starting up programs with the "-e <entry-point>" command-line
|
** Starting up programs with the "-e <entry-point>" command-line
|
||||||
|
|
|
@ -272,7 +272,7 @@
|
||||||
receiving
|
receiving
|
||||||
scsh-version
|
scsh-version
|
||||||
scsh-level-0 ; with-current-input-port error-output-port
|
scsh-level-0 ; with-current-input-port error-output-port
|
||||||
; with-current-output-port exit regexp
|
; with-current-output-port exit
|
||||||
scsh-level-0-internals ; set-command-line-args! init-scsh-vars
|
scsh-level-0-internals ; set-command-line-args! init-scsh-vars
|
||||||
scheme)
|
scheme)
|
||||||
(files top meta-arg))
|
(files top meta-arg))
|
||||||
|
|
33
scsh/top.scm
33
scsh/top.scm
|
@ -36,7 +36,7 @@
|
||||||
;;; -l <file> Load <file> into current package.
|
;;; -l <file> Load <file> into current package.
|
||||||
;;; -lm <file> Load <file> into config package.
|
;;; -lm <file> Load <file> into config package.
|
||||||
;;;
|
;;;
|
||||||
;;; These two require terminating -s <script> arg:
|
;;; These two require a terminating -s or -sfd arg:
|
||||||
;;; -ds Load terminating script into current package.
|
;;; -ds Load terminating script into current package.
|
||||||
;;; -dm Load terminating script into config package.
|
;;; -dm Load terminating script into config package.
|
||||||
;;;
|
;;;
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
;;; Terminating switches:
|
;;; Terminating switches:
|
||||||
;;; -c <exp> Eval <exp>, then exit.
|
;;; -c <exp> Eval <exp>, then exit.
|
||||||
;;; -s <script> Specify <script> to be loaded by a -ds or -dm.
|
;;; -s <script> Specify <script> to be loaded by a -ds or -dm.
|
||||||
;;; -s<num> Script is on file descriptor <num>.
|
;;; -sfd <num> Script is on file descriptor <num>.
|
||||||
;;; -- Interactive scsh.
|
;;; -- Interactive scsh.
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@
|
||||||
;;; - We first expand out any initial \ <filename> meta-arg.
|
;;; - We first expand out any initial \ <filename> meta-arg.
|
||||||
;;; - A switch-list elt is either "-ds", "-dm", or a (switch . arg) pair
|
;;; - A switch-list elt is either "-ds", "-dm", or a (switch . arg) pair
|
||||||
;;; for a -o, -n, -m, -l, or -lm switch.
|
;;; for a -o, -n, -m, -l, or -lm switch.
|
||||||
;;; - Terminating switch is one of {s, c, #f} for -s or -s<num>, -c,
|
;;; - Terminating switch is one of {s, c, #f} for -s or -sfd, -c,
|
||||||
;;; and -- respectively.
|
;;; and -- respectively.
|
||||||
;;; - Terminating arg is the <exp> arg to -c, the <script> arg to -s,
|
;;; - Terminating arg is the <exp> arg to -c, the <script> arg to -s,
|
||||||
;;; the input port for -s<num>, otw #f.
|
;;; the input port for -sfd, otw #f.
|
||||||
;;; - top-entry is the <entry> arg to a -e; #f if none.
|
;;; - top-entry is the <entry> arg to a -e; #f if none.
|
||||||
;;; - command-line args are what's left over after picking off the scsh
|
;;; - command-line args are what's left over after picking off the scsh
|
||||||
;;; switches.
|
;;; switches.
|
||||||
|
@ -83,16 +83,15 @@
|
||||||
(values (reverse switches) 's (car args)
|
(values (reverse switches) 's (car args)
|
||||||
top-entry (cdr args))))
|
top-entry (cdr args))))
|
||||||
|
|
||||||
;; -s<num>
|
;; -sfd <num>
|
||||||
((regexp-exec fd-script-regexp arg) =>
|
((string=? arg "-sfd")
|
||||||
(lambda (m)
|
(if (not (pair? args))
|
||||||
(let* ((fd (string->number (match:substring m 1) 10))
|
(bad-arg "-sfd switch requires argument")
|
||||||
(p (fdes->inport fd)))
|
(let* ((fd (string->number (car args)))
|
||||||
(release-port-handle p) ; Unreveal the port.
|
(p (fdes->inport fd)))
|
||||||
(values (reverse switches)
|
(release-port-handle p) ; Unreveal the port.
|
||||||
's
|
(values (reverse switches) 's p
|
||||||
(fdes->inport fd)
|
top-entry (cdr args)))))
|
||||||
top-entry args))))
|
|
||||||
|
|
||||||
((string=? arg "--")
|
((string=? arg "--")
|
||||||
(if need-script?
|
(if need-script?
|
||||||
|
@ -135,8 +134,6 @@
|
||||||
|
|
||||||
(values (reverse switches) #f #f top-entry '()))))
|
(values (reverse switches) #f #f top-entry '()))))
|
||||||
|
|
||||||
(define fd-script-regexp (make-regexp "^-s([0-9]+)$"))
|
|
||||||
|
|
||||||
;;; Do each -ds, -dm, -o, -n, -m, -l, and -lm switch, and return the final
|
;;; Do each -ds, -dm, -o, -n, -m, -l, and -lm switch, and return the final
|
||||||
;;; result package and a flag saying if the script was loaded by a -ds or -dm.
|
;;; result package and a flag saying if the script was loaded by a -ds or -dm.
|
||||||
|
|
||||||
|
@ -230,7 +227,7 @@
|
||||||
(cons (if (eq? term-switch 's)
|
(cons (if (eq? term-switch 's)
|
||||||
(if (string? term-val)
|
(if (string? term-val)
|
||||||
term-val ; Script file.
|
term-val ; Script file.
|
||||||
"file-descriptor-script"); -s<num>
|
"file-descriptor-script"); -sfd <num>
|
||||||
(car all-args))
|
(car all-args))
|
||||||
args))
|
args))
|
||||||
|
|
||||||
|
@ -300,7 +297,7 @@ switch: -e <entry-point> Specify top-level entry point.
|
||||||
-dm Do script module.
|
-dm Do script module.
|
||||||
|
|
||||||
end-option: -s <script> Specify script.
|
end-option: -s <script> Specify script.
|
||||||
-s<num> Script is on file descriptor <num>.
|
-sfd <num> Script is on file descriptor <num>.
|
||||||
-c <exp> Evaluate expression.
|
-c <exp> Evaluate expression.
|
||||||
-- Interactive session.
|
-- Interactive session.
|
||||||
"))
|
"))
|
||||||
|
|
Loading…
Reference in New Issue