update docs and bash about CLI usage, deprecate old cli classes

(after #547)
This commit is contained in:
MerkushevKirill
2015-03-25 12:58:22 +03:00
parent a62cd193ad
commit 0dcd307333
8 changed files with 65 additions and 41 deletions

View File

@@ -1,7 +0,0 @@
package com.wordnik.swagger.codegen;
public class Readme {
public String getInfo() {
return "See the documentation for swagger-codegen";
}
}

View File

@@ -10,6 +10,11 @@ import io.airlift.airline.Help;
* User: lanwen
* Date: 24.03.15
* Time: 17:56
*
* Command line interface for swagger codegen
* use `swagger-codegen-cli.jar help` for more info
*
* @since 2.1.3-M1
*/
public class SwaggerCodegen {

View File

@@ -31,28 +31,28 @@ public class Generate implements Runnable {
public static final String TEMPLATE_DIR_PARAM = "templateDir";
@Option(name = {"-v", "--verbose"}, description = "verbose mode")
public boolean verbose;
private boolean verbose;
@Option(name = {"-l", "--lang"}, title = "language", required = true,
description = "client language to generate (maybe class name in classpath, required)")
public String lang;
private String lang;
@Option(name = {"-o", "--output"}, title = "output directory",
description = "where to write the generated files (current dir by default)")
public String output = "";
private String output = "";
@Option(name = {"-i", "--input-spec"}, title = "spec file", required = true,
description = "location of the swagger spec, as URL or file (required)")
public String spec;
private String spec;
@Option(name = {"-t", "--template-dir"}, title = "template directory",
description = "folder containing the template files")
public String templateDir;
private String templateDir;
@Option(name = {"-a", "--auth"}, title = "authorization",
description = "adds authorization headers when fetching the swagger definitions remotely. " +
"Pass in a URL-encoded string of name:header with a comma separating multiple values")
public String auth;
private String auth;
@Override
public void run() {

View File

@@ -33,22 +33,22 @@ import static com.google.common.base.Joiner.on;
"specify, and includes default templates to include.")
public class Meta implements Runnable {
public static final Logger LOG = LoggerFactory.getLogger(Meta.class);
private static final Logger LOG = LoggerFactory.getLogger(Meta.class);
public static final String TEMPLATE_DIR_CLASSPATH = "codegen";
public static final String MUSTACHE_EXTENSION = ".mustache";
private static final String TEMPLATE_DIR_CLASSPATH = "codegen";
private static final String MUSTACHE_EXTENSION = ".mustache";
@Option(name = {"-o", "--output"}, title = "output directory",
description = "where to write the generated files (current dir by default)")
public String outputFolder = "";
private String outputFolder = "";
@Option(name = {"-n", "--name"}, title = "name",
description = "the human-readable name of the generator")
public String name = "default";
private String name = "default";
@Option(name = {"-p", "--package"}, title = "package",
description = "the package to put the main class into (defaults to com.wordnik.swagger.codegen)")
public String targetPackage = "com.wordnik.swagger.codegen";
private String targetPackage = "com.wordnik.swagger.codegen";
@Override
public void run() {