diff --git a/bgzip.1 b/bgzip.1 index 616f6e7b7..cc391858a 100644 --- a/bgzip.1 +++ b/bgzip.1 @@ -54,9 +54,7 @@ bgzip \- Block compression/decompression utility .IR size ] .RB [ -@ .IR threads ] -.RI [ file1 ] -.RI [ file2 ] -.RI [ ... ] +.RI [[ file1 ][...]] .PP .SH DESCRIPTION .PP diff --git a/bgzip.c b/bgzip.c index 829ebe8a1..5f577af3a 100644 --- a/bgzip.c +++ b/bgzip.c @@ -199,6 +199,12 @@ int main(int argc, char **argv) fprintf(stderr, "[bgzip] Index file name expected with rebgzip. See -I option.\n"); return 1; } + /* avoid -I / indexfile with multiple inputs while index/reindex. these wont be set during + read/decompress and are not considered even if set */ + if ( (index || reindex) && index_fname && argc - optind > 1) { + fprintf(stderr, "[bgzip] Cannot specify index filename with multiple data file on index, reindex.\n"); + return 1; + } do { isstdin = optind >= argc ? 1 : !strcmp("-", argv[optind]); //using stdin or not? @@ -224,7 +230,7 @@ int main(int argc, char **argv) return 1; } - if ( argc>optind && !isstdin ) + if ( argc>optind && !isstdin ) //named input file that isn't an explicit "-" { if (pstdout) fp = bgzf_open("-", out_mode);