]> git.ipfire.org Git - people/ms/dma.git/commitdiff
newaliases: provide command alias
authorSimon Schubert <2@0x2c.org>
Sat, 6 Jul 2013 19:02:18 +0000 (21:02 +0200)
committerSimon Schubert <2@0x2c.org>
Sat, 6 Jul 2013 19:02:18 +0000 (21:02 +0200)
`newaliases' simply checks the aliases file and ignores any other
argument.

Submitted-by: Arno Töll <arno@debian.org>
dma.c

diff --git a/dma.c b/dma.c
index 63bc850a13210dd3d695762a5d90a65b75607310..25af9b0569f7bfe4467c7a1ecda53d1f60f2249d 100644 (file)
--- a/dma.c
+++ b/dma.c
@@ -457,6 +457,13 @@ main(int argc, char **argv)
                if (argc != 0)
                        errx(1, "invalid arguments");
                goto skipopts;
+       } else if (strcmp(argv[0], "newaliases") == 0) {
+               logident_base = "dma";
+               setlogident(NULL);
+
+               if (read_aliases() != 0)
+                       errx(1, "could not parse aliases file `%s'", config.aliases);
+               exit(0);
        }
 
        opterr = 0;
@@ -580,7 +587,7 @@ skipopts:
        }
 
        if (read_aliases() != 0)
-               errlog(1, "can not read aliases file `%s'", config.aliases);
+               errlog(1, "could not parse aliases file `%s'", config.aliases);
 
        if ((sender = set_from(&queue, sender)) == NULL)
                errlog(1, NULL);