2f4731c424be7ac8fb235f755f0a6d368dd0dcc8 hiram Mon Mar 2 10:47:40 2020 -0800 correct one line header message in usage() no redmine diff --git src/hg/genePredHisto/genePredHisto.c src/hg/genePredHisto/genePredHisto.c index de59df2..d327858 100644 --- src/hg/genePredHisto/genePredHisto.c +++ src/hg/genePredHisto/genePredHisto.c @@ -6,53 +6,51 @@ #include "options.h" #include "genePred.h" #include "genePredReader.h" /* Command line option specifications */ static struct optionSpec optionSpecs[] = { {"ids", OPTION_BOOLEAN}, {NULL, 0} }; static boolean clIds = FALSE; /* print ids */ /* type for function used to get histogram data */ typedef void (*histoFuncType)(struct genePred *gp, FILE *outFh); -void usage(char *msg) +void usage() /* Explain usage and exit. */ { -errAbort("%s\n\n" - "genePredHisto - get data for generating histograms from a genePred file.\n" +errAbort("genePredHisto - get data for generating histograms from a genePred file.\n" "usage:\n" " genePredHisto [options] what genePredFile histoOut\n" "\n" "Options:\n" " -ids - a second column with the gene name, useful for finding outliers.\n" "\n" "The what arguments indicates the type of output. The output file is\n" "a list of numbers suitable for input to textHistogram or similar\n" "The following values are current implemented\n" " exonLen- length of exons\n" " 5utrExonLen- length of 5'UTR regions of exons\n" " cdsExonLen- length of CDS regions of exons\n" " 3utrExonLen- length of 3'UTR regions of exons\n" " exonCnt- count of exons\n" " 5utrExonCnt- count of exons containing 5'UTR\n" " cdsExonCnt- count of exons count CDS\n" - " 3utrExonCnt- count of exons containing 3'UTR\n", - msg); + " 3utrExonCnt- count of exons containing 3'UTR\n"); } struct range /* strand and end range */ { int start; int end; }; struct featBounds /* bounds of each feature within an exon */ { struct range utr5; struct range cds; struct range utr3; }; @@ -198,46 +196,49 @@ else if (sameString(what, "5utrExonLen")) return utr5LenHisto; else if (sameString(what, "cdsExonLen")) return cdsLenHisto; else if (sameString(what, "3utrExonLen")) return utr3LenHisto; else if (sameString(what, "exonCnt")) return exonCntHisto; else if (sameString(what, "5utrExonCnt")) return utr5CntHisto; else if (sameString(what, "cdsExonCnt")) return cdsCntHisto; else if (sameString(what, "3utrExonCnt")) return utr3CntHisto; else - usage("invalid what argument"); + { + verbose(1, "invalid what argument"); + usage(); + } return NULL; } static void genePredHisto(char *what, char *gpFile, char *outFile) /* get data for generating histograms from a genePred file. */ { struct genePredReader *gpr = genePredReaderFile(gpFile, NULL); histoFuncType histoFunc = getHistoFunc(what); struct genePred *gp; FILE *outFh = mustOpen(outFile, "w"); while ((gp = genePredReaderNext(gpr)) != NULL) { histoFunc(gp, outFh); genePredFree(&gp); } carefulClose(&outFh); genePredReaderFree(&gpr); } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, optionSpecs); if (argc != 4) - usage("wrong number of arguments"); + usage(); clIds = optionExists("ids"); genePredHisto(argv[1], argv[2], argv[3]); return 0; }