Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Add help method for SGEN. (#23966)
Browse files Browse the repository at this point in the history
* Add help method.

* Remove unused help information.

* Update the header.
  • Loading branch information
huanwu authored and shmao committed Jan 2, 2018
1 parent b600c80 commit 31a21dd
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Microsoft.XmlSerializer.Generator/src/Sgen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,23 @@ private static Assembly LoadAssembly(string assemblyName, bool throwOnFail)
private void WriteHeader()
{
// do not localize Copyright header
Console.WriteLine(String.Format(CultureInfo.CurrentCulture, "[Microsoft (R) .NET Framework, Version {0}]", ThisAssembly.InformationalVersion));
Console.WriteLine(String.Format(CultureInfo.CurrentCulture, "[Microsoft (R) .NET Core Xml Serialization Generation Utility, Version {0}]", ThisAssembly.InformationalVersion));
Console.WriteLine("Copyright (C) Microsoft Corporation. All rights reserved.");
}

private void WriteHelp()
{
//TBD
Console.WriteLine("In Development");
Console.Out.WriteLine(SR.Format(SR.HelpDescription));
Console.Out.WriteLine(SR.Format(SR.HelpUsage, this.GetType().Assembly.GetName().Name));
Console.Out.WriteLine(SR.Format(SR.HelpDevOptions));
Console.Out.WriteLine(SR.Format(SR.HelpAssembly, "/assembly:", "/a:"));
Console.Out.WriteLine(SR.Format(SR.HelpType, "/type:", "/t:"));
Console.Out.WriteLine(SR.Format(SR.HelpProxy, "/proxytypes", "/p"));
Console.Out.WriteLine(SR.Format(SR.HelpForce, "/force", "/f"));
Console.Out.WriteLine(SR.Format(SR.HelpOut, "/out:", "/o:"));

Console.Out.WriteLine(SR.Format(SR.HelpMiscOptions));
Console.Out.WriteLine(SR.Format(SR.HelpHelp, "/?", "/help"));
}

private static string FormatMessage(bool warning, string message)
Expand Down
43 changes: 43 additions & 0 deletions src/System.Private.Xml/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3343,4 +3343,47 @@
<data name="FailLoadAssemblyUnderPregenMode" xml:space="preserve">
<value>"Fail to load assembly {0} or {0} doesn't exist under PreGen Mode.</value>
</data>
<data name="HelpDescription" xml:space="preserve">
<value>Generates serialization code for use with XmlSerializer.
The utility allows developers to pre-generate code for serialization
building and deploying the assemblies with the application.
</value>
</data>
<data name="HelpUsage" xml:space="preserve">
<value>
Usage: dotnet {0} [[/assembly:&lt;assembly name&gt;] | [&lt;assembly file location&gt;]]
[/type:] [/debug].
</value>
</data>
<data name="HelpDevOptions" xml:space="preserve">
<value> Developer options:</value>
</data>
<data name="HelpAssembly" xml:space="preserve">
<value> {0} Assembly location or display name. Short form is '{1}'.</value>
</data>
<data name="HelpType" xml:space="preserve">
<value> {0} Generate code for serialization/deserialization of the
specified type from the input assembly. Short form is '{1}'.</value>
</data>
<data name="HelpForce" xml:space="preserve">
<value> {0} Forces overwrite of a previously generated assembly.
Short form is '{1}'.</value>
</data>
<data name="HelpProxy" xml:space="preserve">
<value> {0} Generate serialization code only for proxy classes and web
method parameters. Short form is '{1}'.</value>
</data>
<data name="HelpOut" xml:space="preserve">
<value> {0} Output directory name (default: target assembly location).
Short form is '{1}'.</value>
</data>
<data name="HelpMiscOptions" xml:space="preserve">
<value> Miscellaneous options:</value>
</data>
<data name="HelpHelp" xml:space="preserve">
<value> {0} or {1} Show this message</value>
</data>
<data name="MoreHelp" xml:space="preserve">
<value>If you would like more help, please type "sgen {0}".</value>
</data>
</root>

0 comments on commit 31a21dd

Please sign in to comment.