add httpUserAgent option, add customized user-agent support to C#

This commit is contained in:
wing328
2016-03-13 17:28:43 +08:00
parent d3f26f72d9
commit cdecb5133f
14 changed files with 124 additions and 3 deletions

View File

@@ -117,6 +117,9 @@ public class Generate implements Runnable {
@Option(name = {"--release-version"}, title = "release version", description = CodegenConstants.RELEASE_VERSION_DESC)
private String releaseVersion;
@Option(name = {"--http-user-agent"}, title = "http user agent", description = CodegenConstants.HTTP_USER_AGENT)
private String httpUserAgent;
@Override
public void run() {
@@ -210,6 +213,10 @@ public class Generate implements Runnable {
if (isNotEmpty(releaseVersion)) {
configurator.setReleaseVersion(releaseVersion);
}
if (isNotEmpty(httpUserAgent)) {
configurator.setHttpUserAgent(httpUserAgent);
}
applySystemPropertiesKvp(systemProperties, configurator);
applyInstantiationTypesKvp(instantiationTypes, configurator);