diff --git a/main.go b/main.go index dea8384..d4c5284 100644 --- a/main.go +++ b/main.go @@ -48,6 +48,7 @@ func main() { debug = false all = false singlePackageMode = false + fileMode = false ) if parameter := g.Request.GetParameter(); parameter != "" { for _, param := range strings.Split(parameter, ",") { @@ -85,6 +86,14 @@ func main() { default: log.Printf("Err: invalid value for debug: %q", parts[1]) } + case "file-mode": + switch strings.ToLower(parts[1]) { + case boolTrue, "t": + fileMode = true + case boolFalse, "f": + default: + log.Printf("Err: invalid value for file-mode: %q", parts[1]) + } default: log.Printf("Err: unknown parameter: %q", param) } @@ -125,6 +134,17 @@ func main() { continue } + if fileMode { + if s := file.GetService(); s != nil && len(s) > 0{ + encoder := NewGenericTemplateBasedEncoder(templateDir, file, debug, destinationDir) + for _, tmpl := range encoder.Files() { + concatOrAppend(tmpl) + } + } + + continue + } + for _, service := range file.GetService() { encoder := NewGenericServiceTemplateBasedEncoder(templateDir, service, file, debug, destinationDir) for _, tmpl := range encoder.Files() {