From e25dfa5554ae2ade96bb28c45cd983a6f6438365 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 26 Jul 2016 17:14:28 +0200 Subject: mseq: -C to set the current message --- mseq.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'mseq.c') diff --git a/mseq.c b/mseq.c index f20ec5a..7791d68 100644 --- a/mseq.c +++ b/mseq.c @@ -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); -- cgit 1.4.1