を使用する場合boost::program_options
、引数の名前を設定するにはどうすればよいboost::program_options::value<>()
ですか?
#include <iostream>
#include <boost/program_options.hpp>
int main()
{
boost::program_options::options_description desc;
desc.add_options()
("width", boost::program_options::value<int>(),
"Give width");
std::cout << desc << std::endl;
return 0;
}
上記のコードは次のようになります。
--width arg Give width
私が欲しいのは、arg
名前を次のようなよりわかりやすいものに置き換えることですNUM
:
--width NUM Give width