diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 23:30:02 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 23:30:02 +0000 |
commit | d9a39fa2b2dd1fe295819ae0a7e0a21332659798 (patch) | |
tree | 00e895e2dc53277a7b99e53679d3e2fdb64d9a5f /third_party/fuzzymatch | |
parent | e58bda8d0dd948d6e9aec4b60d9ba592d786cf08 (diff) | |
download | chromium_src-d9a39fa2b2dd1fe295819ae0a7e0a21332659798.zip chromium_src-d9a39fa2b2dd1fe295819ae0a7e0a21332659798.tar.gz chromium_src-d9a39fa2b2dd1fe295819ae0a7e0a21332659798.tar.bz2 |
Allow command-line argument to fuzzy matcher for output file.
Review URL: http://codereview.chromium.org/14187
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7628 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/fuzzymatch')
-rw-r--r-- | third_party/fuzzymatch/fuzzymatch.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/third_party/fuzzymatch/fuzzymatch.c b/third_party/fuzzymatch/fuzzymatch.c index 889fc87..c68fcf73 100644 --- a/third_party/fuzzymatch/fuzzymatch.c +++ b/third_party/fuzzymatch/fuzzymatch.c @@ -53,6 +53,7 @@ static int usage(const char *argv0) { fprintf(stderr, "Usage: %s [--highlight] [--no-ignore-scrollbars] " + "[--output filename] " "<input a> <input b>\n", argv0); return 1; } @@ -64,6 +65,8 @@ main(int argc, char **argv) { char highlight = 0; char ignore_scrollbars = 1; + /* Default output filename; can be overridden by command line. */ + const char *output_filename = "highlight.png"; int argi = 1; @@ -72,6 +75,12 @@ main(int argc, char **argv) { highlight = 1; } else if (strcmp("--no-ignore-scrollbars", argv[argi]) == 0) { ignore_scrollbars = 0; + } else if (strcmp("--output", argv[argi]) == 0) { + if (argi + 1 >= argc) { + fprintf(stderr, "missing argument to --output\n"); + return 1; + } + output_filename = argv[++argi]; } else { break; } @@ -142,7 +151,7 @@ main(int argc, char **argv) { pixInvert(d2, d2); pixAnd(d1, d1, d2); pixPaintThroughMask(a, d1, 0, 0, 0xff << 24); - pixWrite("highlight.png", a, IFF_PNG); + pixWrite(output_filename, a, IFF_PNG); } return count > 0; |