From: Tim Vaughan Date: Thu, 5 Sep 2019 08:34:33 +0000 (+0200) Subject: Added command-line option to display version. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=e46944f2bb36d332fce40ec6c6f83bbe367ac71b;p=lambdamail.git Added command-line option to display version. --- diff --git a/lambdamail.scm b/lambdamail.scm index 25454e1..eb5943c 100644 --- a/lambdamail.scm +++ b/lambdamail.scm @@ -293,11 +293,15 @@ (define (print-usage progname) (print "Usage:\n" progname " -h/--help\n" + progname " -v/--version\n" progname " [-u/--user UID] [-g/--group GID] hostname [[port [spooldir]]\n" "\n" "The -u and -g options can be used to set the UID and GID of the process\n" "following the creation of the TCP port listener (which often requires root).")) +(define (print-version) + (print lambdamail-version)) + (define (main) (let ((progname (pathname-file (car (argv)))) (config (make-config "" 25 "/var/spool/mail" '() '()))) @@ -319,6 +323,9 @@ ((or (equal? this-arg "-h") (equal? this-arg "--help")) (print-usage progname)) + ((or (equal? this-arg "-v") + (equal? this-arg "--version")) + (print-version)) (else (print "Unknown option " this-arg "\n") (print-usage progname)))