Coverage report: /home/ellis/comp/core/lib/organ/cli.lisp

KindCoveredAll%
expression045 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; cli.lisp --- Organ CLI
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :organ/cli)
7
 
8
 ;; (defopt organ-output (when *arg* (trace! (or *arg* "output.organ"))))
9
 (defcmd organ-describe ()
10
   (if *args*
11
       ;; TODO typed args
12
       (describe (org-parse :document (pathname (car *args*))))
13
       (describe (org-parse :document #P"readme.org"))))
14
 
15
 (defcmd organ-inspect ()
16
   (if *args*
17
       ;; TODO typed args
18
       (inspect (org-parse :document (pathname (car *args*))))
19
       (inspect (org-parse :document #P"readme.org"))))
20
 
21
 (defcmd organ-show ()
22
   (if *args*
23
       (print (org-parse-lines t (uiop:read-file-string (car *args*))))
24
       (log:error! "missing file arg")))
25
 
26
 (defcmd organ-parse ()
27
   (let ((input (if *args* (car *args*) #P"readme.org")))
28
     (describe (org-parse :document input))))
29
 
30
 (define-cli *organ-cli*
31
   :help t
32
   :package :organ
33
   :name "organ"
34
   :version "0.0.1"
35
   :description "org-mode toolbox"
36
   :thunk organ-describe
37
   :opts ((:name "level" :description "set the log level" :thunk organ-log-level)
38
          (:name "version" :description "print version" :thunk organ-version)
39
          ;; (:name "output" :description "output file" :kind file :thunk organ-output)
40
          )
41
   :cmds ((:name inspect 
42
           :description "inspect an org file"
43
           :thunk organ-inspect)
44
          (:name show
45
           :description "display local org info"
46
           :thunk organ-show)
47
          (:name describe
48
           :description "describe local org info"
49
           :thunk organ-describe)
50
          (:name parse
51
           :thunk organ-parse)))