mseq: -C to set the current message

pull/1/merge
Christian Neukirchen 8 years ago
parent 93842048c6
commit e25dfa5554

@ -6,15 +6,20 @@
.Nd manipulate mail sequence
.Sh SYNOPSIS
.Nm
.Op Fl f
.Op Fl n
.Op Fl r
.Op Fl fnr
.Ar msgs\ ...
.Nm
.Op Fl f
.Op Fl S | Fl A
.Fl S
.Op Fl fr
<
.Ar sequence
.Nm
.Fl A
.Op Fl fr
<
.Ar sequence
.Nm
.Fl C Ar msg
.Sh DESCRIPTION
.Nm
prints, fixes and sets messages in the mail sequence.
@ -55,6 +60,10 @@ Set the mail sequence to the file names passed on standard input.
Like
.Fl S ,
but append to the mail sequence instead of replacing it.
.It Fl C Ar msg
Set the current message to
.Ar msg
and exit.
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
@ -62,6 +71,10 @@ but append to the mail sequence instead of replacing it.
File were the sequence is stored.
(Default:
.Pa ~/.santoku/seq )
.It Ev MAILCUR
Symbolic link referring to the current message.
(Default:
.Pa ~/.santoku/cur )
.El
.Sh EXIT STATUS
.Ex -std

@ -12,8 +12,9 @@
static int fflag;
static int nflag;
static int rflag;
static int Sflag;
static int Aflag;
static char *Cflag;
static int Sflag;
struct name {
char *id;
@ -247,18 +248,24 @@ int
main(int argc, char *argv[])
{
int c;
while ((c = getopt(argc, argv, "fnrSA")) != -1)
while ((c = getopt(argc, argv, "fnrAC:S")) != -1)
switch(c) {
case 'f': fflag = 1; break;
case 'n': nflag = 1; break;
case 'r': rflag = 1; break;
case 'S': Sflag = 1; break;
case 'A': Sflag = Aflag = 1; break;
case 'C': Cflag = optarg; break;
case 'S': Sflag = 1; break;
default:
// XXX usage
exit(1);
}
if (Cflag) {
blaze822_seq_setcur(Cflag);
return 0;
}
if (nflag && Sflag) {
fprintf(stderr, "-n and -S/-A doesn't make sense.\n");
exit(1);

Loading…
Cancel
Save