EntryPoint
1.3.0 - Make getters for BaseOptionAttribute public
모든 최신 .NET 플랫폼에 대한 CLI 인수 파서
UtilityName [command] [-o | --options] [operands]
지원 :
IEEE 표준을 면밀히 따르지만 완전히 명명 된 --option 스타일 옵션과 같은 일반적인 ADBLIB를 포함합니다.
EntryPoint는 Nuget에서 사용할 수 있습니다.
PM> Install-Package EntryPoint
풀 요청 및 제안을 환영하며 일부 작은 작업이 이미 문제에 있습니다.
전체 문서 : https://nick-lucas.github.io/entrypoint/
예제 구현 : https://github.com/nick-lucas/entrypoint/tree/master/test/example
응용 프로그램의 명령 줄 인수를 한 줄로 선언적 POCO로 구문 분석하십시오.
인수는 속성을 사용하여 선언적 pocos로 정의됩니다.
var arguments = Cli . Parse < CliArguments > ( args ) ;
if ( arguments . Option ) {
// ...
} ; public class CliArguments : BaseCliArguments {
public CliArguments ( ) : base ( "MyApplication" ) { }
[ Option ( ShortName : 'o' ,
LongName : "option-1" ) ]
public bool Option { get ; set ; }
}명령에는 전용 API가 있습니다.
Cli . Execute < CliCommands > ( args ) ; public class CliCommands : BaseCliCommands {
[ Command ( "primary" ) ]
public void Primary ( string [ ] args ) {
// Arguments Parsing and Command Code...
}
}