summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tissue27
1 files changed, 16 insertions, 11 deletions
diff --git a/bin/tissue b/bin/tissue
index ff593c6..2e06ac4 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -20,6 +20,7 @@
;;; along with tissue. If not, see <https://www.gnu.org/licenses/>.
(import (rnrs conditions)
+ (rnrs exceptions)
(rnrs io ports)
(srfi srfi-1)
(srfi srfi-26)
@@ -368,17 +369,21 @@ To get usage information for one of these sub-commands, run
((_ (or "-h" "--help"))
(print-usage))
((_ command args ...)
- (apply (match command
- ("news" tissue-news)
- ("list" tissue-list)
- ("edit" tissue-edit)
- ("show" tissue-show)
- (invalid-command
- (format (current-error-port) "Invalid command `~a'~%~%"
- invalid-command)
- (print-usage)
- (exit #f)))
- args))
+ (guard (c ((message-condition? c)
+ (display (condition-message c) (current-error-port))
+ (newline (current-error-port))
+ (exit #f)))
+ (apply (match command
+ ("news" tissue-news)
+ ("list" tissue-list)
+ ("edit" tissue-edit)
+ ("show" tissue-show)
+ (invalid-command
+ (format (current-error-port) "Invalid command `~a'~%~%"
+ invalid-command)
+ (print-usage)
+ (exit #f)))
+ args)))
;; tissue is an alias for `tissue list'
((_)
(tissue-list))))