e70152e44cc66cc599ff6b699eb8adc07f3e656a kent Sat May 24 21:09:34 2014 -0700 Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment. diff --git src/utils/textBetween/textBetween.c src/utils/textBetween/textBetween.c index d5993dd..1c3b7f0 100644 --- src/utils/textBetween/textBetween.c +++ src/utils/textBetween/textBetween.c @@ -1,53 +1,56 @@ /* textBetween - Print all text in file between two input strings.. */ + +/* Copyright (C) 2012 The Regents of the University of California + * See README in this or parent directory for licensing information. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" #include "obscure.h" /* Command line variables. */ boolean withEnds; void usage() /* Explain usage and exit. */ { errAbort( "textBetween - Print all text in file between two input strings including the strings.\n" "usage:\n" " textBetween before after fileName\n" "options:\n" " -withEnds - If set include the before and after strings in the output\n" ); } static struct optionSpec options[] = { {"withEnds", OPTION_BOOLEAN}, {NULL, 0}, }; void textBetween(char *before, char *after, char *fileName) /* textBetween - Print all text in file between two input strings.. */ { char *gulp; size_t gulpSize; readInGulp(fileName, &gulp, &gulpSize); char *s = stringBetween(before, after, gulp); if (s == NULL) errAbort("Couldn't find anything"); if (withEnds) fputs(before, stdout); fputs(s, stdout); if (withEnds) fputs(after, stdout); } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); withEnds = optionExists("withEnds"); if (argc != 4) usage(); textBetween(argv[1], argv[2], argv[3]); return 0; }