mseq: drop -n (now in mscan)

pull/2/head
Christian Neukirchen 8 years ago
parent 9e02ec69f1
commit 94c7dd24cf

@ -6,7 +6,7 @@
.Nd manipulate mail sequence .Nd manipulate mail sequence
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl fnr .Op Fl fr
.Ar msgs\ ... .Ar msgs\ ...
.Nm .Nm
.Fl S .Fl S
@ -49,9 +49,6 @@ The options are as follows:
.It Fl f .It Fl f
Fix non-existing filenames by searching for a message with the same Fix non-existing filenames by searching for a message with the same
Maildir id (but different flags). Maildir id (but different flags).
.It Fl n
Print the sequence numbers of the
.Ar msgs .
.It Fl r .It Fl r
Remove leading indentation from the file names. Remove leading indentation from the file names.
.It Fl S .It Fl S

@ -87,7 +87,7 @@ while :; do
[ -f $HOME/.mless ] && export LESSKEY=$HOME/.mless [ -f $HOME/.mless ] && export LESSKEY=$HOME/.mless
LESSOPEN="|$0 --filter %s" \ LESSOPEN="|$0 --filter %s" \
less -Ps"mless %f?m (message %i of %m).." -R \ 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 case "$?" in
0|1) exit $?;; 0|1) exit $?;;
78) # N go to next unseen message 78) # N go to next unseen message

@ -10,7 +10,6 @@
#include "blaze822.h" #include "blaze822.h"
static int fflag; static int fflag;
static int nflag;
static int rflag; static int rflag;
static int Aflag; static int Aflag;
static char *Cflag; static char *Cflag;
@ -176,7 +175,6 @@ stdinmode()
char *l; char *l;
size_t linelen = 0; size_t linelen = 0;
ssize_t rd; ssize_t rd;
long i = 0;
FILE *outfile; FILE *outfile;
char tmpfile[PATH_MAX]; char tmpfile[PATH_MAX];
@ -210,11 +208,6 @@ stdinmode()
if (line[rd-1] == '\n') if (line[rd-1] == '\n')
line[rd-1] = 0; line[rd-1] = 0;
if (nflag) {
printf("%ld\n", ++i); // always stdout
continue;
}
l = line; l = line;
if (rflag) if (rflag)
while (*l == ' ' || *l == '\t') while (*l == ' ' || *l == '\t')
@ -258,10 +251,9 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int c; int c;
while ((c = getopt(argc, argv, "fnrAC:S")) != -1) while ((c = getopt(argc, argv, "frAC:S")) != -1)
switch(c) { switch(c) {
case 'f': fflag = 1; break; case 'f': fflag = 1; break;
case 'n': nflag = 1; break;
case 'r': rflag = 1; break; case 'r': rflag = 1; break;
case 'A': Sflag = Aflag = 1; break; case 'A': Sflag = Aflag = 1; break;
case 'C': Cflag = optarg; break; case 'C': Cflag = optarg; break;
@ -269,7 +261,7 @@ main(int argc, char *argv[])
default: default:
usage: usage:
fprintf(stderr, fprintf(stderr,
"Usage: mseq [-fnr] [msgs...]\n" "Usage: mseq [-fr] [msgs...]\n"
" mseq -S [-fr] < sequence\n" " mseq -S [-fr] < sequence\n"
" mseq -A [-fr] < sequence\n" " mseq -A [-fr] < sequence\n"
" mseq -C msg\n" " mseq -C msg\n"
@ -282,10 +274,6 @@ main(int argc, char *argv[])
return 0; return 0;
} }
if (nflag && Sflag) {
fprintf(stderr, "error: -n and -S/-A doesn't make sense.\n");
goto usage;
}
if (Sflag && optind != argc) { if (Sflag && optind != argc) {
fprintf(stderr, "error: -S/-A doesn't take arguments.\n"); fprintf(stderr, "error: -S/-A doesn't take arguments.\n");
goto usage; goto usage;
@ -316,18 +304,14 @@ hack:
continue; continue;
} }
while ((f = blaze822_seq_next(seq, a, &iter))) { while ((f = blaze822_seq_next(seq, a, &iter))) {
if (nflag) { char *s = f;
printf("%ld\n", iter.line-1); if (rflag)
} else { while (*s == ' ' || *s == '\t')
char *s = f; s++;
if (rflag) if (fflag)
while (*s == ' ' || *s == '\t') fix(stdout, s);
s++; else
if (fflag) printf("%s\n", s);
fix(stdout, s);
else
printf("%s\n", s);
}
free(f); free(f);
} }
} }

Loading…
Cancel
Save