i do not know how this happened

This commit is contained in:
bdc 1997-04-23 22:51:33 +00:00
parent 0705774634
commit 178cfa8e2e
1 changed files with 18 additions and 7 deletions

View File

@ -56,12 +56,7 @@ For testing load this at a scsh prompt
(define (parse-options argl) (define (parse-options argl)
(let ((options (make-options))) (let ((options (make-options)))
;; Set the input and output filenames first. (let loop ((args (cdr argl)))
(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 ((null? args)
(cond ((not (options:output-executable options)) (cond ((not (options:output-executable options))
(display "error: -o is a required argument") (display "error: -o is a required argument")
@ -71,6 +66,20 @@ For testing load this at a scsh prompt
(display "error: -i is a required argument") (display "error: -i is a required argument")
(newline) (newline)
(usage (car argl))))) (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) "-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) "--temp") ((equal? (car args) "--temp")
(cond ((not (null? (cdr args))) (cond ((not (null? (cdr args)))
(set-options:temp-dir options (cadr args)) (set-options:temp-dir options (cadr args))
@ -130,7 +139,9 @@ For testing load this at a scsh prompt
(define (usage program-name) (define (usage program-name)
(format #t (format #t
(string-append (string-append
"usage: ~a image executable~%" "usage: ~a ~%"
" [-i image]~%"
" [-o executable]~%"
" [--temp directory]~%" " [--temp directory]~%"
" [--cc command]~%" " [--cc command]~%"
" [--ld command]~%" " [--ld command]~%"