summaryrefslogtreecommitdiff
path: root/usr.bin/mg/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mg/main.c')
-rw-r--r--usr.bin/mg/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c
index 634fceb9742..d0d94e365ad 100644
--- a/usr.bin/mg/main.c
+++ b/usr.bin/mg/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.87 2019/06/22 15:38:15 lum Exp $ */
+/* $OpenBSD: main.c,v 1.88 2021/02/23 08:10:51 lum Exp $ */
/* This file is in the public domain. */
@@ -48,7 +48,8 @@ extern void closetags(void);
static __dead void
usage()
{
- fprintf(stderr, "usage: %s [-nR] [-f mode] [+number] [file ...]\n",
+ fprintf(stderr, "usage: %s [-nR] [-f mode] [-u file] [+number] "
+ "[file ...]\n",
__progname);
exit(1);
}
@@ -56,7 +57,7 @@ usage()
int
main(int argc, char **argv)
{
- char *cp, *init_fcn_name = NULL;
+ char *cp, *conffile = NULL, *init_fcn_name = NULL;
PF init_fcn = NULL;
int o, i, nfiles;
int nobackups = 0;
@@ -66,7 +67,7 @@ main(int argc, char **argv)
NULL) == -1)
err(1, "pledge");
- while ((o = getopt(argc, argv, "nRf:")) != -1)
+ while ((o = getopt(argc, argv, "nRf:u:")) != -1)
switch (o) {
case 'R':
allbro = 1;
@@ -80,6 +81,9 @@ main(int argc, char **argv)
"initial function");
init_fcn_name = optarg;
break;
+ case 'u':
+ conffile = optarg;
+ break;
default:
usage();
}
@@ -129,7 +133,7 @@ main(int argc, char **argv)
update(CMODE);
/* user startup file. */
- if ((cp = startupfile(NULL)) != NULL)
+ if ((cp = startupfile(NULL, conffile)) != NULL)
(void)load(cp);
/*