summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhil Pennock <pdp@exim.org>2010-06-06 02:08:50 +0000
committerPhil Pennock <pdp@exim.org>2010-06-06 02:08:50 +0000
commit4b2241d2228351057f63f954de46b0449288e3ba (patch)
tree7eb97c607ee76755d3e898f11f36f84c50ffb953 /src
parent7d9f747b5ef80d2c1126f3aff933346360d2be79 (diff)
Implement --version. Fixes: #973
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 7d1c3b6a6..36f7a1b3d 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/exim.c,v 1.67 2010/06/06 00:27:52 pdp Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.68 2010/06/06 02:08:50 pdp Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -685,8 +685,8 @@ else
* Show supported features *
*************************************************/
-/* This function is called for -bV and for -d to output the optional features
-of the current Exim binary.
+/* This function is called for -bV/--version and for -d to output the optional
+features of the current Exim binary.
Arguments: a FILE for printing
Returns: nothing
@@ -1489,16 +1489,6 @@ running in an unprivileged state. */
unprivileged = (real_uid != root_uid && original_euid != root_uid);
-/* If the first argument is --help, set usage_wanted and pretend there
-are no arguments. This will cause a brief message to be given. We do
-the message generation downstream so we can pick up how we were invoked */
-
-if (argc > 1 && Ustrcmp(argv[1], "--help") == 0)
- {
- argc = 1;
- usage_wanted = TRUE;
- }
-
/* Scan the program's arguments. Some can be dealt with right away; others are
simply recorded for checking and handling afterwards. Do a high-level switch
on the second character (the one after '-'), to save some effort. */
@@ -1563,6 +1553,21 @@ for (i = 1; i < argc; i++)
argrest++;
}
+ /* deal with --option_aliases */
+ else if (switchchar == '-')
+ {
+ if (Ustrcmp(argrest, "help") == 0)
+ {
+ usage_wanted = TRUE;
+ break;
+ }
+ else if (Ustrcmp(argrest, "version") == 0)
+ {
+ switchchar = 'b';
+ argrest = "V";
+ }
+ }
+
/* High-level switch on active initial letter */
switch(switchchar)