output flags once

When asking for help on more than one item,
e.g. foo -h me -h oh -h my just print Flags:
once.

TBR=scroggo@google.com

Change-Id: I67080c7390e6bacf4c36096304dd959229fdd07b
Reviewed-on: https://skia-review.googlesource.com/21660
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
diff --git a/tools/flags/SkCommandLineFlags.cpp b/tools/flags/SkCommandLineFlags.cpp
index bbbc397..bfc9f5e 100644
--- a/tools/flags/SkCommandLineFlags.cpp
+++ b/tools/flags/SkCommandLineFlags.cpp
@@ -233,6 +233,7 @@
     gOnce = true;
 
     bool helpPrinted = false;
+    bool flagsPrinted = false;
     // Loop over argv, starting with 1, since the first is just the name of the program.
     for (int i = 1; i < argc; i++) {
         if (0 == strcmp("-h", argv[i]) || 0 == strcmp("--help", argv[i])) {
@@ -248,8 +249,10 @@
                 // Only print general help message if help for specific flags is not requested.
                 SkDebugf("%s\n%s\n", argv[0], gUsage.c_str());
             }
-            SkDebugf("Flags:\n");
-
+            if (!flagsPrinted) {
+                SkDebugf("Flags:\n");
+                flagsPrinted = true;
+            }
             if (0 == helpFlags.count()) {
                 // If no flags followed --help, print them all
                 SkTDArray<SkFlagInfo*> allFlags;