(if tag (set! args (append args (list "tag" (cdr tag))))))
(let ((uarg (assoc 'uarg session)))
(if uarg (set! args (append args (list "user" (cdr uarg))))))
+ (let ((xargs (assoc 'xargs session)))
+ (if xargs (for-each (lambda (o)
+ (set! args (append args (list (car o) (cdr o)))))
+ (cdr xargs))))
(set! resp (apply dc-ecmd-assert 200 args)))
(let ((id (car (dc-intresp resp))))
(set! trans
(define (autodl-main args)
(let ((dc-server #f) (done #f) (retval 0) (filterexit ""))
- (let ((getopt (make-getopt (cdr args) "whs:S:e:p:t:a:I:E:")) (arg #f))
+ (let ((getopt (make-getopt (cdr args) "whs:S:e:p:t:a:I:E:x:")) (arg #f))
(do ((arg (getopt) (getopt))) ((not (and (pair? arg) (char? (car arg)))) (set! args arg))
(cond ((eq? (car arg) #\h)
(begin (display "usage: autodl [-s server] -S sessfile\n" (current-error-port))
(set! session (cons (cons 'sexpr (dc-lexsexpr (cdr arg))) session)))
((eq? (car arg) #\w)
(set! session (cons '(search-mode . wait) session)))
+ ((eq? (car arg) #\x)
+ (let* ((c (assoc 'xargs session)) (p (string-index (cdr arg) #\=))
+ (recons (cons (substring (cdr arg) 0 p) (substring (cdr arg) (1+ p)))))
+ (if c (set-cdr! c (cons recons (cdr c)))
+ (set! session (cons (cons 'xargs (list recons)) session)))))
)
)
)