Skip to content

Commit

Permalink
Merge pull request #26 from dotnet-campus/t/walterlv/gnu
Browse files Browse the repository at this point in the history
添加一个简单能用的对 GNU命令行标准的支持
  • Loading branch information
lindexi authored Jul 17, 2020
2 parents fd4d031 + 42f0ca0 commit d874bfb
Show file tree
Hide file tree
Showing 33 changed files with 1,182 additions and 990 deletions.
6 changes: 5 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project>

<Import Project="build\Version.props" />

<PropertyGroup>
<PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)</PackageOutputPath>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Authors>walterlv</Authors>
<Company>dotnet-campus</Company>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/dotnet-campus/dotnetCampus.CommandLine</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotnet-campus/dotnetCampus.CommandLine.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>3.1.1</Version>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions build/Version.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<Version>3.2.0</Version>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions dotnetCampus.CommandLine.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
README.md = README.md
build\Version.props = build\Version.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.CommandLine.Analyzer.VisualStudio", "src\dotnetCampus.CommandLine.Analyzer.VisualStudio\dotnetCampus.CommandLine.Analyzer.VisualStudio.csproj", "{26788488-0584-49B1-940F-DB9D07FD90AC}"
Expand All @@ -24,6 +25,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.CommandLine.Te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.CommandLine.Performance", "tests\dotnetCampus.CommandLine.Performance\dotnetCampus.CommandLine.Performance.csproj", "{7B664373-31A0-47AB-9076-15153EF4722A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{F26EAA27-AA79-4B28-890C-D759F1D1A374}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetCampus.CommandLine.Sample", "samples\dotnetCampus.CommandLine.Sample\dotnetCampus.CommandLine.Sample.csproj", "{B44D0273-A584-4845-899A-597D52387DC7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -49,13 +54,18 @@ Global
{7B664373-31A0-47AB-9076-15153EF4722A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B664373-31A0-47AB-9076-15153EF4722A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B664373-31A0-47AB-9076-15153EF4722A}.Release|Any CPU.Build.0 = Release|Any CPU
{B44D0273-A584-4845-899A-597D52387DC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B44D0273-A584-4845-899A-597D52387DC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B44D0273-A584-4845-899A-597D52387DC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B44D0273-A584-4845-899A-597D52387DC7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{470A596C-D8C4-4506-A71A-4BEEA08BCC62} = {7DDA8183-3606-4B08-86E3-A4537860448F}
{7B664373-31A0-47AB-9076-15153EF4722A} = {7DDA8183-3606-4B08-86E3-A4537860448F}
{B44D0273-A584-4845-899A-597D52387DC7} = {F26EAA27-AA79-4B28-890C-D759F1D1A374}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {52E30C59-C5C8-4517-811A-667BFA2BFABB}
Expand Down
16 changes: 16 additions & 0 deletions samples/dotnetCampus.CommandLine.Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using dotnetCampus.Cli.Properties;
using dotnetCampus.Cli.Standard;

namespace dotnetCampus.Cli
{
class Program
{
static void Main(string[] args)
{
CommandLine.Parse(args, LocalizableStrings.ResourceManager)
.AddStandardHandlers()
.AddHandler<SampleOptions>(o => o.Run())
.Run();
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="SamplePropertyDescription" xml:space="preserve">
<value>Output any text passed to this option.</value>
</data>
<data name="SampleVerbDescription" xml:space="preserve">
<value>Use sample command line action to output some text.</value>
</data>
</root>
Loading

0 comments on commit d874bfb

Please sign in to comment.