Binapi generator: improved file input
[govpp.git] / cmd / binapi-generator / main.go
index 732b4f3..af60628 100644 (file)
@@ -32,6 +32,7 @@ import (
 func init() {
        flag.Usage = func() {
                fmt.Fprintf(os.Stderr, "Usage: %s [OPTION] API_FILES\n", os.Args[0])
+               fmt.Fprintln(os.Stderr, "Provide API_FILES by file name, or with full path including extension.")
                fmt.Fprintln(os.Stderr, "Parse API_FILES and generate Go bindings based on the options given:")
                flag.PrintDefaults()
        }
@@ -45,8 +46,10 @@ func main() {
                importPrefix     = flag.String("import-prefix", "", "Define import path prefix to be used to import types.")
                generatorPlugins = flag.String("gen", "rpc", "List of generator plugins to run for files.")
 
-               printVersion = flag.Bool("version", false, "Prints version and exits.")
-               debugLog     = flag.Bool("debug", false, "Enable verbose logging.")
+               printVersion     = flag.Bool("version", false, "Prints version and exits.")
+               debugLog         = flag.Bool("debug", false, "Enable verbose logging.")
+               noVersionInfo    = flag.Bool("no-version-info", false, "Disable version info in generated files.")
+               noSourcePathInfo = flag.Bool("no-source-path-info", false, "Disable source path info in generated files.")
        )
        flag.Parse()
 
@@ -71,8 +74,10 @@ func main() {
        }
 
        opts := binapigen.Options{
-               ImportPrefix: *importPrefix,
-               OutputDir:    *theOutputDir,
+               ImportPrefix:     *importPrefix,
+               OutputDir:        *theOutputDir,
+               NoVersionInfo:    *noVersionInfo,
+               NoSourcePathInfo: *noSourcePathInfo,
        }
        if opts.OutputDir == "binapi" {
                if wd, _ := os.Getwd(); filepath.Base(wd) == "binapi" {