Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1578)

Unified Diff: mojom/mojom_parser/gen_cmd.go

Issue 1893683003: Update the gen command to not fail on generator flags. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/gen_cmd.go
diff --git a/mojom/mojom_parser/gen_cmd.go b/mojom/mojom_parser/gen_cmd.go
index 8689c33ef0f03a3016c49a2abdbd7057c221b221..7a8c07443fe32e3adbee791d1287c7a493208595 100644
--- a/mojom/mojom_parser/gen_cmd.go
+++ b/mojom/mojom_parser/gen_cmd.go
@@ -97,7 +97,9 @@ func genCmd(args []string) {
"use --gen-arg-arg=value. To pass --arg, you would use --gen-arg-arg.\n")
}
- if err := flagSet.Parse(args[2:]); err != nil {
+ // If err is not ErrHelp, the only way to figure out what it was is to look at
+ // the message provided for users.
vardhan 2016/04/15 22:53:35 that's unfortunate
+ if err := flagSet.Parse(args[2:]); err != nil && !strings.HasPrefix(err.Error(), "flag provided but not defined") {
if err != flag.ErrHelp {
fmt.Fprintln(os.Stderr, err.Error())
}
« no previous file with comments | « mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698