diff options
| author | Gertjan van den Burg <burg@ese.eur.nl> | 2016-09-20 16:41:52 +0200 |
|---|---|---|
| committer | Gertjan van den Burg <burg@ese.eur.nl> | 2016-09-20 16:41:52 +0200 |
| commit | 014d9b5e6b0de17a1910c32347bf86de48e06af4 (patch) | |
| tree | ea87fcc0dc21b5fde4723f22e0b007870edbc348 /src/GenSVMtraintest.c | |
| parent | Fix memory leak (diff) | |
| download | gensvm-014d9b5e6b0de17a1910c32347bf86de48e06af4.tar.gz gensvm-014d9b5e6b0de17a1910c32347bf86de48e06af4.zip | |
Use file stream for errors too
Diffstat (limited to 'src/GenSVMtraintest.c')
| -rw-r--r-- | src/GenSVMtraintest.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/GenSVMtraintest.c b/src/GenSVMtraintest.c index 4d99c04..34b1677 100644 --- a/src/GenSVMtraintest.c +++ b/src/GenSVMtraintest.c @@ -18,6 +18,7 @@ #define MINARGS 2 extern FILE *GENSVM_OUTPUT_FILE; +extern FILE *GENSVM_ERROR_FILE; // function declarations void exit_with_help(); @@ -45,7 +46,7 @@ void exit_with_help() "file\n"); printf("-p p-value : set the value of p in the lp norm " "(1.0 <= p <= 2.0)\n"); - printf("-q : quiet mode (no output)\n"); + printf("-q : quiet mode (no output, not even errors!)\n"); printf("-r rho : choose the weigth specification (1 = unit, 2 = " "group)\n"); printf("-t type: kerneltype (0=LINEAR, 1=POLY, 2=RBF, 3=SIGMOID)\n"); @@ -153,6 +154,7 @@ void parse_command_line(int argc, char **argv, struct GenModel *model, coef = 0.0; GENSVM_OUTPUT_FILE = stdout; + GENSVM_ERROR_FILE = stderr; // parse options for (i=1; i<argc; i++) { @@ -205,9 +207,13 @@ void parse_command_line(int argc, char **argv, struct GenModel *model, break; case 'q': GENSVM_OUTPUT_FILE = NULL; + GENSVM_ERROR_FILE = NULL; i--; break; default: + // this one should always print explicitly to + // stderr, even if '-q' is supplied, because + // otherwise you can't debug cmdline flags. fprintf(stderr, "Unknown option: -%c\n", argv[i-1][1]); exit_with_help(); |
