in fm_bot, use -foo to remove a source

We're not using -foo today to do anything but print a "sorry" error.
Might as well make it something productive.

In this case, it happens that Codec_PngRoundTrip is flaky on my laptop;
I'm guessing the blame belongs with CoreGraphics.  Anyway, this lets me
skip it but run all other tests with a line like

    tests -Codec_PngRoundTrip b=cpu

Change-Id: I479a71575eadfc1f870a3c48c130b2b57797ac54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317316
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/tools/fm/fm_bot/fm_bot.go b/tools/fm/fm_bot/fm_bot.go
index eb781f9..f077b8a 100644
--- a/tools/fm/fm_bot/fm_bot.go
+++ b/tools/fm/fm_bot/fm_bot.go
@@ -71,15 +71,6 @@
 func parseWork(args []string, gms []string, tests []string) (*work, error) {
 	w := &work{}
 	for _, arg := range args {
-		// I wish we could parse flags here too, but it's too late.
-		if strings.HasPrefix(arg, "-") {
-			msg := "Is '%s' an fm flag? If so please pass it using flag=value syntax."
-			if flag.Lookup(arg[1:]) != nil {
-				msg = "Please pass fm_bot flags like '%s' on the command line before the FM binary."
-			}
-			return nil, fmt.Errorf(msg, arg)
-		}
-
 		// Everything after a # is a comment.
 		if strings.HasPrefix(arg, "#") {
 			break
@@ -96,6 +87,17 @@
 			continue
 		}
 
+		// -foo to remove foo if already added (e.g. by gms, tests).
+		if strings.HasPrefix(arg, "-") {
+			for i, s := range w.Sources {
+				if s == arg[1:] {
+					w.Sources = append(w.Sources[:i], w.Sources[i+1:]...)
+					break
+				}
+			}
+			continue
+		}
+
 		// Is this an option to pass through to fm?
 		if parts := strings.Split(arg, "="); len(parts) == 2 {
 			f := "-"