summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-03-10 16:47:35 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-03-10 16:47:35 +0000
commit30d75150f00e00b0ff384483229c399ac3d70118 (patch)
tree901090e0b6a1d221bd727213eb0581e854d5b052 /usr.bin/mg
parent7b22dadf7f6c7e0dc46dd5420d68e94a63d257b7 (diff)
add -n command line switch to disable backup file generation, handy
when you use mg for your mail from within mutt etc from PR3930, Carson Harding <harding@motd.ca>, Thanks!
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/main.c11
-rw-r--r--usr.bin/mg/mg.16
2 files changed, 13 insertions, 4 deletions
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c
index abbee6b6395..ca074f2708b 100644
--- a/usr.bin/mg/main.c
+++ b/usr.bin/mg/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.34 2005/03/09 16:20:48 jfb Exp $ */
+/* $OpenBSD: main.c,v 1.35 2005/03/10 16:47:33 henning Exp $ */
/*
* Mainline.
@@ -32,9 +32,13 @@ main(int argc, char **argv)
char *cp, *init_fcn_name = NULL;
PF init_fcn = NULL;
int o, i, nfiles, status;
+ int nobackups = 0;
- while ((o = getopt(argc, argv, "f:")) != -1)
+ while ((o = getopt(argc, argv, "nf:")) != -1)
switch (o) {
+ case 'n':
+ nobackups = 1;
+ break;
case 'f':
if (init_fcn_name != NULL)
errx(1, "cannot specify more than one "
@@ -87,6 +91,9 @@ main(int argc, char **argv)
(void)load(cp);
#endif /* !NO_STARTUP */
+ if (nobackups)
+ makebkfile(FFARG, 0);
+
for (nfiles = 0, i = 0; i < argc; i++) {
if (argv[i][0] == '+' && strlen(argv[i]) >= 2) {
int lval;
diff --git a/usr.bin/mg/mg.1 b/usr.bin/mg/mg.1
index b4e84ba98dd..7d842ac598b 100644
--- a/usr.bin/mg/mg.1
+++ b/usr.bin/mg/mg.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mg.1,v 1.20 2004/07/26 16:25:10 mjc Exp $
+.\" $OpenBSD: mg.1,v 1.21 2005/03/10 16:47:34 henning Exp $
.\"
.Dd February 25, 2000
.Dt MG 1
@@ -24,7 +24,7 @@ be any reason to learn more editor types than emacs or
.Pp
The options are as follows:
.Pp
-.Bl -tag -width xxxxx -compact
+.Bl -tag -width Ds
.It Ar +number
Go to the line specified by number (do not insert
a space between the "+" sign and the number).
@@ -35,6 +35,8 @@ line of the file, +-2 will be second last, and so on.
Run the mode command for all buffers created from
arguments on the command line, including the
scratch buffer and all files.
+.It Fl n
+Turn off backup file generation.
.El
.Pp
Normal editing commands are very similar to Gnu Emacs.