Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (usage specs lastrun)
- (string-join
- (map
- (lambda (spec)
- (let* ((long-name (car spec))
- (props (cdr spec))
- (single-char (assoc-ref props 'single-char))
- (description (assoc-ref props 'description))
- (value (assoc-ref props 'value))
- (value-desc (assoc-ref props 'value-desc))
- (default (assoc-ref props 'default))
- (lastrun (hash-ref lastrun long-name)))
- (string-append
- (if single-char
- (string #\- (car single-char)))
- " "
- (string-append "--" (symbol->string long-name))
- (if value
- (if value-desc
- (string-append " " (car value-desc) "\n")
- " ARG\n")
- "\n")
- (if description (car description) "NO DESCRIPTION")
- (if value
- (cond
- (lastrun (string-append " (default " lastrun ")"))
- (default (string-append " (default " (car default) ")"))
- (else ""))
- (if (or lastrun default) " (default)" "")))))
- specs)
- "\n\n"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement