From f34a284b42961eef3f121be84b728a6c1301ad9d Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 9 Aug 2016 19:03:59 +0200 Subject: [PATCH] mseq: add -c to override . --- man/mseq.1 | 18 ++++++++++++++---- mseq.c | 5 +++-- 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"