diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2020-08-21 17:30:05 +0200 |
---|---|---|
committer | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2020-08-21 17:30:05 +0200 |
commit | ff0a39377533365e128c3364395c6bfbae8d5b1a (patch) | |
tree | e079b3d9ff76209b17442ee5ca62d0ded83ce4ab /binapigen | |
parent | 8c3f04816a8fd23a5eabde1b36cb2471e06229bc (diff) |
Expose version info control flags
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Change-Id: Ida098149bdf23dccafb7b1f2ac2bb83f21f918c9
Diffstat (limited to 'binapigen')
-rw-r--r-- | binapigen/generate.go | 4 | ||||
-rw-r--r-- | binapigen/run.go | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/binapigen/generate.go b/binapigen/generate.go index 679dd54..698c798 100644 --- a/binapigen/generate.go +++ b/binapigen/generate.go @@ -55,7 +55,9 @@ func GenerateAPI(gen *Generator, file *File) *GenFile { g.P("// versions:") g.P("// binapi-generator: ", version.Version()) g.P("// VPP: ", g.gen.vppVersion) - g.P("// source: ", g.file.Desc.Path) + if !gen.opts.NoSourcePathInfo { + g.P("// source: ", g.file.Desc.Path) + } } g.P() diff --git a/binapigen/run.go b/binapigen/run.go index d3a181a..f7776c9 100644 --- a/binapigen/run.go +++ b/binapigen/run.go @@ -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) { |