diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-26 22:09:02 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-26 22:09:26 +0200 |
commit | 3d694808eb0dafc8c952ea4716265c040bdd2277 (patch) | |
tree | 4c39ad601328ccfe79f6fb2f1376ed742a1f0e6f /mseq.c | |
parent | 3257fce1b8f00ced0807db7b4263ab855f296aa8 (diff) | |
download | mblaze-3d694808eb0dafc8c952ea4716265c040bdd2277.tar.gz mblaze-3d694808eb0dafc8c952ea4716265c040bdd2277.tar.xz mblaze-3d694808eb0dafc8c952ea4716265c040bdd2277.zip |
mseq: add usage
Diffstat (limited to 'mseq.c')
-rw-r--r-- | mseq.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mseq.c b/mseq.c index 87ff6f1..b1a1c7f 100644 --- a/mseq.c +++ b/mseq.c @@ -259,7 +259,13 @@ main(int argc, char *argv[]) case 'C': Cflag = optarg; break; case 'S': Sflag = 1; break; default: - // XXX usage + usage: + fprintf(stderr, + "Usage: mseq [-fnr] [msgs...]\n" + " mseq -S [-fr] < sequence\n" + " mseq -A [-fr] < sequence\n" + " mseq -C msg\n" + ); exit(1); } @@ -269,12 +275,12 @@ main(int argc, char *argv[]) } if (nflag && Sflag) { - fprintf(stderr, "-n and -S/-A doesn't make sense.\n"); - exit(1); + fprintf(stderr, "error: -n and -S/-A doesn't make sense.\n"); + goto usage; } if (Sflag && optind != argc) { - fprintf(stderr, "-S/-A doesn't take arguments.\n"); - exit(1); + fprintf(stderr, "error: -S/-A doesn't take arguments.\n"); + goto usage; } if (optind == argc && !isatty(0)) |