diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index 19802877b..5814efeb2 100644 --- a/src/main.c +++ b/src/main.c @@ -654,7 +654,21 @@ static int getparameter(char *flag, /* f or -long-flag */ return URG_FAILED_INIT; case 'w': /* get the output string */ - GetStr(&config->writeout, nextarg); + if('@' == *nextarg) { + /* the data begins with a '@' letter, it means that a file name + or - (stdin) follows */ + FILE *file; + nextarg++; /* pass the @ */ + if(strequal("-", nextarg)) + file = stdin; + else + file = fopen(nextarg, "r"); + config->writeout = file2string(file); + if(file && (file != stdin)) + fclose(stdin); + } + else + GetStr(&config->writeout, nextarg); break; case 'x': /* proxy */ |