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

Unified Diff: mojom/generators/common/cli.go

Issue 2091493002: Switch to the new go generator in the mojo tree. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix more things. Created 4 years, 6 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
Index: mojom/generators/common/cli.go
diff --git a/mojom/generators/common/cli.go b/mojom/generators/common/cli.go
index 1599f7407a37d8b4605ae3e13438fc076a4d9232..ce33738f506e37150e68be6af93e6308c315c494 100644
--- a/mojom/generators/common/cli.go
+++ b/mojom/generators/common/cli.go
@@ -19,12 +19,16 @@ import (
"mojom/generated/mojom_files"
)
-// GetConfig provides the primary interface for generators.
-// By calling GetConfig, a generator implements the command line interface
+// GetCliConfig provides the primary interface for generators.
+// By calling GetCliConfig, a generator implements the command line interface
// that is used by all generators.
func GetCliConfig(args []string) GeneratorConfig {
- config := new(generatorCliConfig)
flagSet := flag.NewFlagSet("Generator Common Flag Set", flag.ExitOnError)
+ return GetCustomCliConfig(args, flagSet)
+}
+
+func GetCustomCliConfig(args []string, flagSet *flag.FlagSet) GeneratorConfig {
vardhan 2016/06/24 01:36:07 suggestion: maybe GetCliConfigWithFlagSet?
azani 2016/06/24 19:21:21 Done.
+ config := new(generatorCliConfig)
var fileGraphFile string
flagSet.StringVar(&fileGraphFile, "file-graph", "-",

Powered by Google App Engine
This is Rietveld 408576698