Recognize stat_dir_type_empty
[govpp.git] / binapigen / run.go
index d3a181a..d632519 100644 (file)
@@ -29,9 +29,10 @@ import (
 )
 
 type Options struct {
-       OutputDir     string // output directory for generated files
-       ImportPrefix  string // prefix for import paths
-       NoVersionInfo bool   // disables generating version info
+       OutputDir        string // output directory for generated files
+       ImportPrefix     string // prefix for import paths
+       NoVersionInfo    bool   // disables generating version info
+       NoSourcePathInfo bool   // disables the 'source: /path' comment
 }
 
 func Run(apiDir string, filesToGenerate []string, opts Options, f func(*Generator) error) {
@@ -42,7 +43,7 @@ func Run(apiDir string, filesToGenerate []string, opts Options, f func(*Generato
 }
 
 func run(apiDir string, filesToGenerate []string, opts Options, fn func(*Generator) error) error {
-       apifiles, err := vppapi.ParseDir(apiDir)
+       apiFiles, err := vppapi.ParseDir(apiDir)
        if err != nil {
                return err
        }
@@ -52,10 +53,10 @@ func run(apiDir string, filesToGenerate []string, opts Options, fn func(*Generat
                if err != nil {
                        return fmt.Errorf("cannot resolve import path for output dir %s: %w", opts.OutputDir, err)
                }
-               logrus.Infof("resolved import path prefix: %s", opts.ImportPrefix)
+               logrus.Debugf("resolved import path prefix: %s", opts.ImportPrefix)
        }
 
-       gen, err := New(opts, apifiles, filesToGenerate)
+       gen, err := New(opts, apiFiles, filesToGenerate)
        if err != nil {
                return err
        }
@@ -72,7 +73,6 @@ func run(apiDir string, filesToGenerate []string, opts Options, fn func(*Generat
                        return err
                }
        }
-
        if err = gen.Generate(); err != nil {
                return err
        }