aboutsummaryrefslogtreecommitdiff
path: root/src/c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-06-18 15:39:44 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-06-18 15:39:44 -0400
commit93485b7e9ffa0089d0bd32c066362d8bc31c06f5 (patch)
treea7acf93da4014f509bbed2c303b32e1dc91668b1 /src/c
parentf251dc46c40501704bfebf2d778577b1f1dc3484 (diff)
add force flag for filename
Diffstat (limited to 'src/c')
-rw-r--r--src/c/quikr_train.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/c/quikr_train.c b/src/c/quikr_train.c
index 08a1f0a..1260b86 100644
--- a/src/c/quikr_train.c
+++ b/src/c/quikr_train.c
@@ -34,7 +34,7 @@ int main(int argc, char **argv) {
unsigned long long position = 0;
int verbose = 0;
-
+ int force_name = 0;
char *fasta_filename = NULL;
char *output_file = NULL;
@@ -45,6 +45,7 @@ int main(int argc, char **argv) {
while (1) {
static struct option long_options[] = {
{"verbose", no_argument, 0, 'v'},
+ {"force_name", no_argument, 0, 'f'},
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
{"input", required_argument, 0, 'i'},
@@ -55,7 +56,7 @@ int main(int argc, char **argv) {
int option_index = 0;
- c = getopt_long (argc, argv, "i:o:k:hvV", long_options, &option_index);
+ c = getopt_long (argc, argv, "i:o:k:fhvV", long_options, &option_index);
if (c == -1)
break;
@@ -73,6 +74,9 @@ int main(int argc, char **argv) {
case 'v':
verbose = 1;
break;
+ case 'f':
+ force_name = 1;
+ break;
case 'V':
printf("%s\n", VERSION);
exit(EXIT_SUCCESS);
@@ -117,7 +121,7 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
- if(strcmp(&output_file[strlen(output_file) - 3], ".gz") != 0) {
+ if(strcmp(&output_file[strlen(output_file) - 3], ".gz") != 0 && !force_name) {
char *temp = malloc(strlen(output_file) + 4);
if(temp == NULL) {
fprintf(stderr, "Could not allocate enough memory\n");