Coverage report: /home/ellis/comp/core/app/packy/cli.lisp

KindCoveredAll%
expression036 0.0
branch02 0.0
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; cli.lisp --- Packy CLI Defs
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :packy/cli)
7
 
8
 (defvar *pk-target* nil)
9
 (defopt pk-version (print-version *cli*))
10
 (defopt pk-log-level 
11
   (setq *log-level* (if *arg* (if (stringp *arg*)
12
                                   (sb-int:keywordicate (string-upcase *arg*))
13
                                   *arg*)
14
                         :info)))
15
 (defopt pk-target (setq *pk-target* *arg*))
16
 (defcmd pk-show  ()
17
   (println (clap:active-opts *packy-cli*))
18
   (println (list :optc *optc* :argc *argc*
19
                  :opts *opts* :args *args*)))
20
 
21
 (define-cli *packy-cli*
22
   :help t
23
   :name "packy"
24
   :version "0.1.0"
25
   :description "Universal Package Manager"
26
   :thunk pk-show
27
   :opts ((:name "level" :description "set the log level" :thunk level-opt)
28
          (:name "version" :description "print version" :thunk version-opt))
29
   :cmds ((:name show
30
           :opts ((:name "target" :thunk pk-target))
31
           :thunk pk-show)))
32
 
33
 (defmain start-packy ()
34
   (with-cli (*packy-cli* :args (args))
35
     (do-cmd *packy-cli*)))
36