Skip to content

Commit

Permalink
Add option to disable Pascal case (closes #10)
Browse files Browse the repository at this point in the history
  • Loading branch information
mganss committed Sep 29, 2015
1 parent 463b97b commit 36ad856
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ From the command line:
```
Usage: XmlSchemaClassGenerator.Console [OPTIONS]+ xsdFile...
Generate C# classes from XML Schema files.
Version 0.8.5718.30340
Version 0.8.5750.32346
xsdFiles may contain globs, e.g. "content\{schema,xsd}\**\*.xsd".
Append - to option to disable it, e.g. --interface-.
Expand Down Expand Up @@ -70,6 +70,8 @@ Options:
classes
-t, --interface generate interfaces for groups and attribute
groups (default is enabled)
-a, --pascal use Pascal case for class and property names (
default is enabled)
```

From code:
Expand Down
5 changes: 4 additions & 1 deletion XmlSchemaClassGenerator.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ static void Main(string[] args)
var emitOrder = false;
var entityFramework = false;
var interfaces = true;
var pascal = true;

var options = new OptionSet {
{ "h|help", "show this message and exit", v => showHelp = v != null },
Expand Down Expand Up @@ -61,6 +62,7 @@ A file name may be given by appending a pipe sign (|) followed by a file name (l
{ "0|nullable", "generate nullable adapter properties for optional elements/attributes w/o default values", v => nullables = v != null },
{ "f|ef", "generate Entity Framework Code First compatible classes", v => entityFramework = v != null },
{ "t|interface", "generate interfaces for groups and attribute groups (default is enabled)", v => interfaces = v != null },
{ "a|pascal", "use Pascal case for class and property names (default is enabled)", v => pascal = v != null },
};

var files = options.Parse(args);
Expand Down Expand Up @@ -94,7 +96,8 @@ A file name may be given by appending a pipe sign (|) followed by a file name (l
EmitOrder = emitOrder,
IntegerDataType = integerType,
EntityFramework = entityFramework,
GenerateInterfaces = interfaces
GenerateInterfaces = interfaces,
NamingScheme = pascal ? NamingScheme.PascalCase : NamingScheme.Direct
};

if (pclCompatible)
Expand Down
4 changes: 2 additions & 2 deletions XmlSchemaClassGenerator/XmlSchemaClassGenerator.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<projectUrl>https://github.com/mganss/XmlSchemaClassGenerator</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>Add interfaces.</releaseNotes>
<releaseNotes>Add option to disable Pascal case.</releaseNotes>
<copyright>Copyright 2013-2015 Michael Ganss</copyright>
<tags>xsd</tags>
</metadata>
Expand All @@ -20,4 +20,4 @@
<file src="..\XmlSchemaClassGenerator.Console\bin\Release\XmlSchemaClassGenerator.dll" target="tools" />
<file src="..\XmlSchemaClassGenerator.Console\bin\Release\XmlSchemaClassGenerator.pdb" target="tools" />
</files>
</package>
</package>

0 comments on commit 36ad856

Please sign in to comment.