From 98af68fe26e1bcba9c29f5f3fa2ae4ba9cace339 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 12 Dec 2013 20:20:08 -0800 Subject: [PATCH] cwebp: let -- stop parameter parsing this enables cwebp to accept input files starting with '-' Change-Id: I13b506886c3df8a4e8fb350f3d365eaf7e072a4a --- examples/cwebp.c | 3 +++ man/cwebp.1 | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/cwebp.c b/examples/cwebp.c index 0fa83d1e..2d1f076d 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -895,6 +895,9 @@ int main(int argc, const char *argv[]) { #endif } else if (!strcmp(argv[c], "-v")) { verbose = 1; + } else if (!strcmp(argv[c], "--")) { + if (c < argc - 1) in_file = argv[++c]; + break; } else if (argv[c][0] == '-') { fprintf(stderr, "Error! Unknown option '%s'\n", argv[c]); HelpLong(); diff --git a/man/cwebp.1 b/man/cwebp.1 index 9ac40311..f2a9b8bb 100644 --- a/man/cwebp.1 +++ b/man/cwebp.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH CWEBP 1 "October 23, 2013" +.TH CWEBP 1 "December 12, 2013" .SH NAME cwebp \- compress an image file to a WebP file .SH SYNOPSIS @@ -255,6 +255,8 @@ cwebp \-q 50 -lossless picture.png \-o picture_lossless.webp cwebp \-q 70 picture_with_alpha.png \-o picture_with_alpha.webp .br cwebp \-sns 70 \-f 50 \-size 60000 picture.png \-o picture.webp +.br +cwebp \-o picture.webp \-\- \-\-\-picture.png .SH AUTHORS \fBcwebp\fP was written by the WebP team.