コマンドライン引数の処理 tappe 19年前 getopt() getopt_long() getopt_long_only() とかを使えば楽になるかと。 上記の関数を使う場合は、 unistd.h getopt.h のインクルードを忘れずに。