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

KindCoveredAll%
expression031 0.0
branch04 0.0
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; tui.lisp --- Terminal User Interface
2
 
3
 ;; Utilities for building Terminal UIs.
4
 
5
 ;;; Commentary:
6
 
7
 ;; This package provides 
8
 
9
 ;;; Code:
10
 (in-package :cli/tui)
11
 
12
 (defvar *prompt2* "> ")
13
 
14
 (defun completing-read (prompt completions &optional default)
15
   "Print PROMPT then read input using linedit with completions. DEFAULT is the
16
 value returned when the input doesn't match a member of COMPLETIONS. A default
17
 value of :ERROR indicates that an error will be signaled when input doesn't
18
 match."
19
   (let ((val (linedit:formedit :prompt1 prompt :prompt2 *prompt2* :completions completions)))
20
     (if default
21
         (if (member val completions :test 'equal)
22
             val
23
             (if (eql default :error)
24
                 (error 'invalid-argument :reason (format nil "input must match one of: ~S" completions) :item val)
25
                 val))
26
         val)))
27
 
28
 ;; (defmacro defprompt (name ))