CommandLine
1.0.0
.NETでCLIアプリケーションを構築するためのサポートライブラリ。
Changelogの最新の変更を参照してください。
近日公開…
近日公開…
ビルド可能な例は、XMPLディレクトリにあります。
静的クラスWiZaRo.CommandLine.Fluent.Startには、流fluent APIへのエントリポイントが含まれています。
メソッドDefineCommandLine(Action<CommandBuilder>)使用すると、コマンドラインAPIを流fluentで明示的に定義できます。
Start . DefineCommandLine ( rootBuilder => rootBuilder
. AddCommand ( "HelloWorld" , commandBuilder => commandBuilder
. SetDescription ( "Salutes the globe." )
. UseHandler ( CommandHandler . Create ( HelloWorld ) ) )
. AddCommand ( "Show" , commandBuilder => commandBuilder
. SetDescription ( "Shows a message prettily." )
. AddOption < string > ( new [ ] { "--message" , "-m" } , optionBuilder => optionBuilder
. Require ( ) )
. UseHandler ( CommandHandler . Create < string , IFormatter > ( Show ) ) ) )前の例では、2つのコマンドを作成します。
HelloWorld()メソッドによって管理されたオプションがないHelloWorldコマンド。そして--messageオプションを備えたShowコマンドとShow(string, IFormatter)メソッドによって管理されます。 DefineCommandLineFromでは、既存または生成されたRootCommandからコマンドラインAPIを定義できます。
完全な例は、流fluentの例で見つけることができます。
近日公開…
問題で新しい問題を開きます。
私たちの行動規範、環境の設定方法、プル要求を提出するプロセスの詳細については、貢献ガイドラインをお読みください。
ウィルヘルム・ザピアイン
System.Commandlineのすべての貢献者に感謝します。
MIT-要約