From a33831e21a3e09441974f5b6da92ad136cb8bdc8 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 12 Dec 2013 20:20:08 -0800 Subject: [PATCH] dwebp: let -- stop parameter parsing this enables dwebp to accept input files starting with '-' Change-Id: I1e2c9c7bc2963d77be039c99e72f744560f0b0a2 --- examples/dwebp.c | 3 +++ man/dwebp.1 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/dwebp.c b/examples/dwebp.c index 5a2c0b65..fca9c9a7 100644 --- a/examples/dwebp.c +++ b/examples/dwebp.c @@ -649,6 +649,9 @@ int main(int argc, const char *argv[]) { #endif } else if (!strcmp(argv[c], "-incremental")) { incremental = 1; + } else if (!strcmp(argv[c], "--")) { + if (c < argc - 1) in_file = argv[++c]; + break; } else if (argv[c][0] == '-') { fprintf(stderr, "Unknown option '%s'\n", argv[c]); Help(); diff --git a/man/dwebp.1 b/man/dwebp.1 index 9a616763..36bbf0c9 100644 --- a/man/dwebp.1 +++ b/man/dwebp.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH DWEBP 1 "November 26, 2013" +.TH DWEBP 1 "December 12, 2013" .SH NAME dwebp \- decompress a WebP file to an image file .SH SYNOPSIS @@ -99,6 +99,8 @@ http://www.webmproject.org/code/contribute/submitting-patches/ dwebp picture.webp \-o output.png .br dwebp picture.webp \-ppm \-o output.ppm +.br +dwebp \-o output.ppm \-\- \-\-\-picture.webp .SH AUTHORS \fBdwebp\fP was written by the WebP team.