From time to time, I find myself needing to handle command-line arguments in Java either for Java-based applications or for main() function implementations that provide a simple testing mechanism ...
オプション数が多いコンソールアプリケーションを開発していると、引数を制御するコードが複雑になってしまいがちです。そこで本稿ではCommand Line Parser Libraryというオープンソースを紹介します。このライブラリを使うとフィールドに属性を宣言するだけ ...
続けて、入力された引数をOptionsクラスに展開して計算をするコードを見てみましょう。 メインプログラム(Programクラス) using System; using CommandLine; namespace ConsoleSample { class Program { //アプリケーションの開始場所 static void Main(string[] args) { ...