Wrap code in a module - pee - Pee a password manager;Pee - because you have to...
(HTM) git clone git://vernunftzentrum.de/pee.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 04e8d3e30e3c8b88f18730379dcb61bc5997d6f0
(DIR) parent 9e7f0ab506153a53572d09812a0330702449f309
(HTM) Author: Christian Kellermann <ckeen@pestilenz.org>
Date: Thu, 14 Jan 2016 11:59:32 +0100
Wrap code in a module
This uncovered a couple of small bugs an unintended overloading of
existing identifiers. This also enables the scrutinizer to help us.
Diffstat:
pee.scm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/pee.scm b/pee.scm
@@ -14,9 +14,11 @@
;; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-(use (srfi 1 4 14) matchable posix tweetnacl utils crypto-helper getopt-long stty)
+(module pee (main)
+(import chicken scheme)
+(use (srfi 1 4 14) matchable posix tweetnacl utils crypto-helper getopt-long stty files data-structures irregex files ports extras)
-(define-constant program-name "pee")
+(define-constant program-name-string "pee")
(define-constant program-version "0.1")
(define-constant program-description "A password manager for the command line.")
@@ -248,7 +250,7 @@
(value #f))))
(define (banner)
- (printf "~a Version ~a -- ~a~%" program-name program-version program-description))
+ (printf "~a Version ~a -- ~a~%" program-name-string program-version program-description))
(define (do-add db-name db p e)
(when (alist-ref e db equal?)
@@ -383,5 +385,7 @@
((alist-ref 'password opts) => (lambda (e) (do-password db e)))
(else (banner) (print "Error: Don't know what to do") (print (usage options)) (exit 1))))))
(exit 0)))
+)
+(import pee)
(main (cdr (argv)))