文件名称:CommandLineParser:一个用于解析命令行参数的库。 基于.NET Core的C#语言编写
文件大小:34KB
文件格式:ZIP
更新时间:2024-02-23 18:33:47
c-sharp parsing command-line command-line-parser ParsingC#
CommandLineParser 用于解析命令行参数的库。 基于.NET Core的C#语言编写。 产品特点 未命名的值 布尔标志 指令 例子 1.注册类型和解析 定义一个将包含已解析参数的类: class Arguments { [ Option ( 'i' , " input " )] public string Input { get ; set ; } [ Option ( 'o' , " output " )] public string Output { get ; set ; } } 在main方法中,实例化一个Parser对象并注册类型。 之后,将args从Main方法传递到解析器的Parse方法: public static void Main ( string [] args ) { var parser = new Parser (); parser . Register < Arguments>( arguments => { Console . WriteLine ( argu
【文件预览】:
CommandLineParser-master
----tests()
--------CommandLineParser.Tests()
----src()
--------CommandLineParser()
----CommandLine.sln(3KB)
----.gitignore(4KB)
----README.md(2KB)
----CommandLineParser.TestClient()
--------Program.cs(2KB)
--------CommandLineParser.TestClient.csproj(837B)
--------Properties()
----.gitattributes(2KB)
----.vscode()
--------launch.json(1KB)
--------tasks.json(386B)