diff options
| -rw-r--r-- | kaakaa/tools/base.scm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kaakaa/tools/base.scm b/kaakaa/tools/base.scm index 959640a..895d191 100644 --- a/kaakaa/tools/base.scm +++ b/kaakaa/tools/base.scm @@ -30,9 +30,12 @@ #:description "File path to read" #:required? #t))) #:proc (lambda* (#:key path) - ;; TODO: Handle non-existent files. - (display (call-with-input-file path - get-string-all))) + (if (file-exists? path) + (display (call-with-input-file path + get-string-all)) + (format (current-output-port) + "Error: File ~a does not exist~%" + path))) #:title (lambda* (#:key path) (string-append "Read " path)) #:kind (const "read"))) |
