The Lambda Lab
/
projects
/
lambdamail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
388c4d8
)
Added command-line option to display version.
author
Tim Vaughan
<tgvaughan@gmail.com>
Thu, 5 Sep 2019 08:34:33 +0000
(10:34 +0200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Thu, 5 Sep 2019 08:34:33 +0000
(10:34 +0200)
lambdamail.scm
patch
|
blob
|
history
diff --git
a/lambdamail.scm
b/lambdamail.scm
index
25454e1
..
eb5943c
100644
(file)
--- a/
lambdamail.scm
+++ b/
lambdamail.scm
@@
-293,11
+293,15
@@
(define (print-usage progname)
(print "Usage:\n"
progname " -h/--help\n"
(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)."))
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" '() '())))
(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 "-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)))
(else
(print "Unknown option " this-arg "\n")
(print-usage progname)))