aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-09 19:03:59 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-09 19:03:59 +0200
commitf34a284b42961eef3f121be84b728a6c1301ad9d (patch)
treeb2cff40b088a6f2c048387b69a7b2f6a809e5918
parentc9c5346e6376e62d3879d816a93889b1ffb87133 (diff)
downloadmblaze-f34a284b42961eef3f121be84b728a6c1301ad9d.tar.gz
mseq: add -c to override .
-rw-r--r--man/mseq.118
-rw-r--r--mseq.c5
2 files changed, 17 insertions, 6 deletions
diff --git a/man/mseq.1 b/man/mseq.1
index 055d87a..e514ece 100644
--- a/man/mseq.1
+++ b/man/mseq.1
@@ -7,6 +7,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl fr
+.Op Fl c Ar file
.Ar msgs\ ...
.Nm
.Fl S
@@ -45,6 +46,10 @@ If standard output is not a terminal, the new sequence is also printed.
.Pp
The options are as follows:
.Bl -tag -width Ds
+.It Fl c Ar file
+Behave as if
+.Ar file
+was the current message.
.It Fl f
Fix non-existing filenames by searching for a message with the same
Maildir id (but different flags).
@@ -63,14 +68,19 @@ and exit.
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
-.It Ev MAILSEQ
-File were the sequence is stored.
-(Default:
-.Pa ~/.mblaze/seq )
.It Ev MAILCUR
Symbolic link referring to the current message.
(Default:
.Pa ~/.mblaze/cur )
+.It Ev MAILDOT
+When set, overrides the current message.
+(Prefer using
+.Fl c
+instead.)
+.It Ev MAILSEQ
+File were the sequence is stored.
+(Default:
+.Pa ~/.mblaze/seq )
.El
.Sh EXIT STATUS
.Ex -std
diff --git a/mseq.c b/mseq.c
index 7e4c539..d282811 100644
--- a/mseq.c
+++ b/mseq.c
@@ -251,8 +251,9 @@ int
main(int argc, char *argv[])
{
int c;
- while ((c = getopt(argc, argv, "frAC:S")) != -1)
+ while ((c = getopt(argc, argv, "c:frAC:S")) != -1)
switch(c) {
+ case 'c': setenv("MAILDOT", optarg, 1); break;
case 'f': fflag = 1; break;
case 'r': rflag = 1; break;
case 'A': Sflag = Aflag = 1; break;
@@ -261,7 +262,7 @@ main(int argc, char *argv[])
default:
usage:
fprintf(stderr,
- "Usage: mseq [-fr] [msgs...]\n"
+ "Usage: mseq [-fr] [-c file] [msgs...]\n"
" mseq -S [-fr] < sequence\n"
" mseq -A [-fr] < sequence\n"
" mseq -C msg\n"