From cfc3914a542006ec12189a176e6347006171e653 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 28 Sep 2015 21:20:15 -0400 Subject: 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. --- shroud/ui.scm | 2 +- shroud/ui/list.scm | 2 +- shroud/ui/show.scm | 2 +- 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)) -- cgit v1.2.3