Changeset 32967 in project


Ignore:
Timestamp:
12/08/15 21:01:24 (5 years ago)
Author:
Jim Ursetto
Message:

chicken-doc: add -h, --help and -? support

Location:
release/4/chicken-doc/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/chicken-doc/trunk/chicken-doc-cmd.scm

    r23058 r32967  
    128128 (get-environment-variable "CHICKEN_DOC_WARNINGS"))
    129129
    130 (with-output-to-pager
    131  (lambda ()
    132    (let ((o (car (command-line-arguments))))
    133      (cond ((string=? o "-s")
    134             (describe-signatures (list (lookup (cdr (command-line-arguments))))))
    135            ((string=? o "-f")
    136             ;; Is this useful?  Identifier search ("find") on signatures, showing path.
    137             ;; I wonder if we need the signature, or just the path.
    138             (search-only (cadr (command-line-arguments))))
    139            ((string=? o "-m")
    140             ;; Not doing search-and-describe because when there are zero
    141             ;; matches, that will throw an error
    142             (search-only (irregex (cadr (command-line-arguments)))))
    143            ((string=? o "-c")
    144             (describe-contents (lookup (cdr (command-line-arguments)))))
    145            ((string=? o "-i")
    146             ;; FIXME: decompose-pathspec required here but won't work yet.
    147             (describe (lookup (cdr (command-line-arguments)))))
    148            (else
    149             (let ((ids (command-line-arguments)))
    150               (if (null? (cdr ids))
    151                   (doc-dwim (car ids))
    152                   (doc-dwim ids))))))))
     130(let ((o (car (command-line-arguments))))
     131  (cond ((null? o)
     132         (usage))
     133        ((or (string=? o "-h")
     134             (string=? o "--help")
     135             (string=? o "-?"))
     136         (usage))
     137        (else
     138         (with-output-to-pager
     139          (lambda ()
     140            (cond ((string=? o "-s")
     141                   (describe-signatures (list (lookup (cdr (command-line-arguments))))))
     142                  ((string=? o "-f")
     143                   ;; Is this useful?  Identifier search ("find") on signatures, showing path.
     144                   ;; I wonder if we need the signature, or just the path.
     145                   (search-only (cadr (command-line-arguments))))
     146                  ((string=? o "-m")
     147                   ;; Not doing search-and-describe because when there are zero
     148                   ;; matches, that will throw an error
     149                   (search-only (irregex (cadr (command-line-arguments)))))
     150                  ((string=? o "-c")
     151                   (describe-contents (lookup (cdr (command-line-arguments)))))
     152                  ((string=? o "-i")
     153                   ;; FIXME: decompose-pathspec required here but won't work yet.
     154                   (describe (lookup (cdr (command-line-arguments)))))
     155                  (else
     156                   (let ((ids (command-line-arguments)))
     157                     (if (null? (cdr ids))
     158                         (doc-dwim (car ids))
     159                         (doc-dwim ids))))))))))
  • release/4/chicken-doc/trunk/chicken-doc.setup

    r29552 r32967  
    1 (define version "0.4.6")
     1(define version "0.4.7")
    22
    33(compile -s -O2 -d1 -S chicken-doc.scm -j chicken-doc -j chicken-doc-text)
Note: See TracChangeset for help on using the changeset viewer.