(sieve-version): New function. Supports the required --version option.
Showing
1 changed file
with
10 additions
and
1 deletions
... | @@ -929,12 +929,18 @@ | ... | @@ -929,12 +929,18 @@ |
929 | (display " -o, --output FILENAME Set output file name\n") | 929 | (display " -o, --output FILENAME Set output file name\n") |
930 | (display " -L, --lib-dir DIRNAME Set sieve library directory name\n") | 930 | (display " -L, --lib-dir DIRNAME Set sieve library directory name\n") |
931 | (display " -g, --guimb Make output file executable for guimb\n") | 931 | (display " -g, --guimb Make output file executable for guimb\n") |
932 | (display " -d, --debug LEVEL Set debugging level\n\n") | 932 | (display " -d, --debug LEVEL Set debugging level\n") |
933 | (display " --version Show program version\n\n") | ||
933 | (display "If -o option is not given, the compiled program is executed\n") | 934 | (display "If -o option is not given, the compiled program is executed\n") |
934 | (display "immediately. It operates on the user system mailbox unless\n") | 935 | (display "immediately. It operates on the user system mailbox unless\n") |
935 | (display "mailbox is given in the command line.\n") | 936 | (display "mailbox is given in the command line.\n") |
936 | (exit 0)) | 937 | (exit 0)) |
937 | 938 | ||
939 | (define (sieve-version) | ||
940 | (display "sieve.scm (GNU %PACKAGE% %VERSION%)") | ||
941 | (newline) | ||
942 | (exit 0)) | ||
943 | |||
938 | ;;; Parse command line | 944 | ;;; Parse command line |
939 | 945 | ||
940 | (use-modules (ice-9 getopt-long)) | 946 | (use-modules (ice-9 getopt-long)) |
... | @@ -948,6 +954,7 @@ | ... | @@ -948,6 +954,7 @@ |
948 | (lib-dir (single-char #\L) | 954 | (lib-dir (single-char #\L) |
949 | (value #t)) | 955 | (value #t)) |
950 | (guimb (single-char #\g)) | 956 | (guimb (single-char #\g)) |
957 | (version) | ||
951 | (help (single-char #\h)))) | 958 | (help (single-char #\h)))) |
952 | 959 | ||
953 | (define program-name (car (command-line))) | 960 | (define program-name (car (command-line))) |
... | @@ -967,6 +974,8 @@ | ... | @@ -967,6 +974,8 @@ |
967 | (set! output (cdr x))) | 974 | (set! output (cdr x))) |
968 | ((guimb) | 975 | ((guimb) |
969 | (set! guimb-header #t)) | 976 | (set! guimb-header #t)) |
977 | ((version) | ||
978 | (sieve-version)) | ||
970 | ((help) | 979 | ((help) |
971 | (sieve-usage)) | 980 | (sieve-usage)) |
972 | ('() | 981 | ('() | ... | ... |
-
Please register or sign in to post a comment