Removed the redundant -i and -o switches.

This commit is contained in:
shivers 1997-04-10 01:17:22 +00:00
parent 0a32248ba8
commit 906fceb86f
1 changed files with 8 additions and 16 deletions

View File

@ -55,7 +55,13 @@ For testing load this at a scsh prompt
;;; returns them in an options structure
(define (parse-options argl)
(let ((options (make-options)))
(let loop ((args (cdr argl)))
;; Set the input and output filenames first.
(if (< (length argl) 3) (usage (car argl)))
(set-options:output-executable options (caddr args))
(set-options:input-image options (cadr args))
(let loop ((args (cdddr argl)))
(cond ((null? args)
(cond ((not (options:output-executable options))
(display "error: -o is a required argument")
@ -65,20 +71,6 @@ For testing load this at a scsh prompt
(display "error: -i is a required argument")
(newline)
(usage (car argl)))))
((equal? (car args) "-o")
(cond ((not (null? (cdr args)))
(set-options:output-executable options (cadr args))
(loop (cddr args)))
(else
(display "error: -o requires argument") (newline)
(usage (car argl)))))
((equal? (car args) "-i")
(cond ((not (null? (cdr args)))
(set-options:input-image options (cadr args))
(loop (cddr args)))
(else
(display "error: -i requires argument") (newline)
(usage (car argl)))))
((equal? (car args) "--temp")
(cond ((not (null? (cdr args)))
(set-options:temp-dir options (cadr args))
@ -138,7 +130,7 @@ For testing load this at a scsh prompt
(define (usage program-name)
(format #t
(string-append
"usage: ~a -i image -o executable~%"
"usage: ~a image executable~%"
" [--temp directory]~%"
" [--cc command]~%"
" [--ld command]~%"