Add a "library" option to generate with sub-template

This commit is contained in:
xhh
2015-08-04 18:32:54 +08:00
parent bfb4629ab7
commit aff21e5e6b
5 changed files with 61 additions and 19 deletions

View File

@@ -40,6 +40,10 @@ public class Generate implements Runnable {
description = "client language to generate (maybe class name in classpath, required)")
private String lang;
@Option(name = {"-L", "--library"}, title = "library",
description = "library template (sub-template) to use")
private String library;
@Option(name = {"-o", "--output"}, title = "output directory",
description = "where to write the generated files (current dir by default)")
private String output = "";
@@ -105,6 +109,7 @@ public class Generate implements Runnable {
}
CodegenConfig config = forName(lang);
config.setLibrary(library);
config.setOutputDir(new File(output).getAbsolutePath());
if (null != templateDir) {