summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-09-28 21:20:15 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-09-28 21:20:15 -0400
commitcfc3914a542006ec12189a176e6347006171e653 (patch)
tree83781d50e5821c8b7b64e81d5121f789b6179dce
parent288969b63fa8492f741fe89ba194920b5efd0400 (diff)
ui: Return #f from subcommands when the database hasn't changed.
* shroud/ui.scm (shroud-main): Do not save database when #f is returned from a subcommand. * shroud/ui/list.scm (shroud-list): Return #f. * shroud/ui/show.scm (shroud-show): Likewise.
-rw-r--r--shroud/ui.scm2
-rw-r--r--shroud/ui/list.scm2
-rw-r--r--shroud/ui/show.scm2
3 files changed, 3 insertions, 3 deletions
diff --git a/shroud/ui.scm b/shroud/ui.scm
index 3cceac3..75106c9 100644
--- a/shroud/ui.scm
+++ b/shroud/ui.scm
@@ -174,6 +174,6 @@ ARGS is the list of arguments received by the 'throw' handler."
(result (parameterize ((program-name (make-program-name
command)))
(apply proc config db args))))
- (unless (eq? db result)
+ (when result
(mkdir-p (dirname db-file))
(save-secrets result db-file user-id))))))))
diff --git a/shroud/ui/list.scm b/shroud/ui/list.scm
index fdf5f10..d6a745a 100644
--- a/shroud/ui/list.scm
+++ b/shroud/ui/list.scm
@@ -52,4 +52,4 @@ Show the names of all secrets in the database.~%")
db)
;; We don't alter the database.
- db))
+ #f))
diff --git a/shroud/ui/show.scm b/shroud/ui/show.scm
index 21a35e2..6e0c61f 100644
--- a/shroud/ui/show.scm
+++ b/shroud/ui/show.scm
@@ -93,4 +93,4 @@ Show secret named ID.~%")
(display-secret secret keys))
;; Database remains unaltered.
- db))
+ #f))