)
(define (autodl-main args)
- (let ((dc-server #f) (done #f) (retval 0))
+ (let ((dc-server #f) (done #f) (retval 0) (filterexit ""))
(let ((getopt (make-getopt (cdr args) "whs:S:e:p:t:a:I:")) (arg #f))
(do ((arg (getopt) (getopt))) ((not (and (pair? arg) (char? (car arg)))) (set! args arg))
(cond ((eq? (car arg) #\h)
(let ((c (assoc 'info-file session)))
(if c (set-cdr! c (cdr arg))
(set! session (cons (cons 'info-file (cdr arg)) session)))))
+ ((eq? (car arg) #\E)
+ (let ((c (assoc 'estat-file session)))
+ (if c (set-cdr! c (cdr arg))
+ (set! session (cons (cons 'estat-file (cdr arg)) session)))))
((eq? (car arg) #\e)
(set! session (cons (cons 'sexpr (dc-lexsexpr (cdr arg))) session)))
((eq? (car arg) #\w)
(begin (logf (string-append "transfer " (number->string (car ires)) " done"))
(set! trans (assq-remove! trans (car ires)))
(set! done #t)
+ (set! filterexit (cadr tr))
(throw 'sig 0))
(begin (logf (string-append "transfer " (number->string (car ires)) " disappeared"))
(set! trans (assq-remove! trans (car ires)))))))))
)))
(lambda (key sig)
(logf "forcing quit")))
+ (if (assoc 'estat-file session)
+ (let ((op (open-output-file (cdr (assoc 'estat-file session)))))
+ (write filterexit op)
+ (newline op)
+ (close-port op)))
(exit retval)
)
)