about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-31 19:46:43 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-31 19:46:43 +0200
commit94c7dd24cf48a842ad1595731ea4477a68e57d29 (patch)
tree8e0b30d041f269b31e4eeb6f3a9f9ca30bfb7a57
parent9e02ec69f18c186b5a23775aeb771965f259fb76 (diff)
downloadmblaze-94c7dd24cf48a842ad1595731ea4477a68e57d29.tar.gz
mblaze-94c7dd24cf48a842ad1595731ea4477a68e57d29.tar.xz
mblaze-94c7dd24cf48a842ad1595731ea4477a68e57d29.zip
mseq: drop -n (now in mscan)
-rw-r--r--man/mseq.15
-rwxr-xr-xmless2
-rw-r--r--mseq.c36
3 files changed, 12 insertions, 31 deletions
diff --git a/man/mseq.1 b/man/mseq.1
index 2b00930..5f6d417 100644
--- 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
index 06e7312..8ad858e 100755
--- 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
index 60b1986..f68e573 100644
--- 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);
 		}
 	}