引数処理
標準ライブラリ
コマンドライン引数はstd::env::args
を介して取得できます。これはそれぞれの引数を文字列として生成するイテレータを返します。
$ ./args 1 2 3
My path is ./args.
I got 3 arguments: ["1", "2", "3"].
クレート
Alternatively, there are numerous crates that can provide extra functionality when creating command-line applications. One of the more popular command line argument crates being clap
.