mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 94c7dd24cf48a842ad1595731ea4477a68e57d29
parent 9e02ec69f18c186b5a23775aeb771965f259fb76
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Sun, 31 Jul 2016 19:46:43 +0200

mseq: drop -n (now in mscan)

Diffstat:
man/mseq.1 | 5+----
mless | 2+-
mseq.c | 36++++++++++--------------------------
3 files changed, 12 insertions(+), 31 deletions(-)

diff --git a/man/mseq.1 b/man/mseq.1 @@ -6,7 +6,7 @@ .Nd manipulate mail sequence .Sh SYNOPSIS .Nm -.Op Fl fnr +.Op Fl fr .Ar msgs\ ... .Nm .Fl S @@ -49,9 +49,6 @@ The options are as follows: .It Fl f Fix non-existing filenames by searching for a message with the same Maildir id (but different flags). -.It Fl n -Print the sequence numbers of the -.Ar msgs . .It Fl r Remove leading indentation from the file names. .It Fl S diff --git a/mless b/mless @@ -87,7 +87,7 @@ while :; do [ -f $HOME/.mless ] && export LESSKEY=$HOME/.mless LESSOPEN="|$0 --filter %s" \ less -Ps"mless %f?m (message %i of %m).." -R \ - "+:e $(mseq -n .)$nl" //scan $(mseq -n :) + "+:e $(mscan -n .)$nl" //scan $(mscan -n :) case "$?" in 0|1) exit $?;; 78) # N go to next unseen message diff --git a/mseq.c b/mseq.c @@ -10,7 +10,6 @@ #include "blaze822.h" static int fflag; -static int nflag; static int rflag; static int Aflag; static char *Cflag; @@ -176,7 +175,6 @@ stdinmode() char *l; size_t linelen = 0; ssize_t rd; - long i = 0; FILE *outfile; char tmpfile[PATH_MAX]; @@ -210,11 +208,6 @@ stdinmode() if (line[rd-1] == '\n') line[rd-1] = 0; - if (nflag) { - printf("%ld\n", ++i); // always stdout - continue; - } - l = line; if (rflag) while (*l == ' ' || *l == '\t') @@ -258,10 +251,9 @@ int main(int argc, char *argv[]) { int c; - while ((c = getopt(argc, argv, "fnrAC:S")) != -1) + while ((c = getopt(argc, argv, "frAC:S")) != -1) switch(c) { case 'f': fflag = 1; break; - case 'n': nflag = 1; break; case 'r': rflag = 1; break; case 'A': Sflag = Aflag = 1; break; case 'C': Cflag = optarg; break; @@ -269,7 +261,7 @@ main(int argc, char *argv[]) default: usage: fprintf(stderr, - "Usage: mseq [-fnr] [msgs...]\n" + "Usage: mseq [-fr] [msgs...]\n" " mseq -S [-fr] < sequence\n" " mseq -A [-fr] < sequence\n" " mseq -C msg\n" @@ -282,10 +274,6 @@ main(int argc, char *argv[]) return 0; } - if (nflag && Sflag) { - fprintf(stderr, "error: -n and -S/-A doesn't make sense.\n"); - goto usage; - } if (Sflag && optind != argc) { fprintf(stderr, "error: -S/-A doesn't take arguments.\n"); goto usage; @@ -316,18 +304,14 @@ hack: continue; } while ((f = blaze822_seq_next(seq, a, &iter))) { - if (nflag) { - printf("%ld\n", iter.line-1); - } else { - char *s = f; - if (rflag) - while (*s == ' ' || *s == '\t') - s++; - if (fflag) - fix(stdout, s); - else - printf("%s\n", s); - } + char *s = f; + if (rflag) + while (*s == ' ' || *s == '\t') + s++; + if (fflag) + fix(stdout, s); + else + printf("%s\n", s); free(f); } }