Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tools: Move over to using boost PO's required flag

  • Loading branch information...
commit 1d8fafed01309b5be152e867a608618773036134 1 parent 48ec18a
@zmoratto zmoratto authored
View
5 src/asp/Tools/disparitydebug.cc
@@ -60,7 +60,7 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
po::options_description positional("");
positional.add_options()
- ("input-file", po::value(&opt.input_file_name), "Input disparity map");
+ ("input-file", po::value(&opt.input_file_name)->required(), "Input disparity map");
po::positional_options_description positional_desc;
positional_desc.add("input-file", 1);
@@ -70,9 +70,6 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
asp::check_command_line( argc, argv, opt, general_options,
positional, positional_desc, usage );
- if ( opt.input_file_name.empty() )
- vw_throw( ArgumentErr() << "Missing input file!\n"
- << usage << general_options );
if ( opt.output_prefix.empty() )
opt.output_prefix = fs::path(opt.input_file_name).stem();
}
View
5 src/asp/Tools/mer2camera.cc
@@ -48,7 +48,7 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
po::options_description positional("");
positional.add_options()
- ("img-file", po::value(&opt.img_file) );
+ ("img-file", po::value(&opt.img_file)->required() );
po::positional_options_description positional_desc;
positional_desc.add("img-file", 1);
@@ -58,9 +58,6 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
asp::check_command_line( argc, argv, opt, general_options,
positional, positional_desc, usage );
- if ( opt.img_file.empty() )
- vw_throw( ArgumentErr() << "Missing required input file.\n"
- << usage << general_options );
if ( opt.output_prefix.empty() )
opt.output_prefix = fs::path(opt.img_file).stem();
}
View
10 src/asp/Tools/orthoproject.cc
@@ -75,9 +75,9 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
po::options_description positional("");
positional.add_options()
- ("dem", po::value(&opt.dem_file))
- ("camera-image", po::value(&opt.image_file))
- ("camera-model", po::value(&opt.camera_model_file))
+ ("dem", po::value(&opt.dem_file)->required())
+ ("camera-image", po::value(&opt.image_file)->required())
+ ("camera-model", po::value(&opt.camera_model_file)->required())
("output-file", po::value(&opt.output_file));
po::positional_options_description positional_desc;
@@ -91,10 +91,6 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
asp::check_command_line( argc, argv, opt, general_options,
positional, positional_desc, usage );
- if ( opt.dem_file.empty() || opt.image_file.empty() ||
- opt.camera_model_file.empty() )
- vw_throw( ArgumentErr() << "Missing input files!\n"
- << usage << general_options );
if ( !color_text.empty() ) {
opt.do_color=true;
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
View
5 src/asp/Tools/point2dem.cc
@@ -124,7 +124,7 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
po::options_description positional("");
positional.add_options()
- ("input-file", po::value(&opt.pointcloud_filename), "Input Point Cloud");
+ ("input-file", po::value(&opt.pointcloud_filename)->required(), "Input Point Cloud");
po::positional_options_description positional_desc;
positional_desc.add("input-file", 1);
@@ -134,9 +134,6 @@ void handle_arguments( int argc, char *argv[], Options& opt ) {
asp::check_command_line( argc, argv, opt, general_options,
positional, positional_desc, usage );
- if ( opt.pointcloud_filename.empty() )
- vw_throw( ArgumentErr() << "Missing point cloud.\n"
- << usage << general_options );
if ( opt.out_prefix.empty() )
opt.out_prefix =
prefix_from_pointcloud_filename( opt.pointcloud_filename );
View
11 src/asp/Tools/stereo.cc
@@ -45,9 +45,9 @@ void vw::handle_arguments( int argc, char *argv[], Options& opt ) {
po::options_description positional("");
positional.add_options()
- ("left-input-image", po::value(&opt.in_file1), "Left Input Image")
- ("right-input-image", po::value(&opt.in_file2), "Right Input Image")
- ("left-camera-model", po::value(&opt.cam_file1), "Left Camera Model File")
+ ("left-input-image", po::value(&opt.in_file1)->required(), "Left Input Image")
+ ("right-input-image", po::value(&opt.in_file2)->required(), "Right Input Image")
+ ("left-camera-model", po::value(&opt.cam_file1)->required(), "Left Camera Model File")
("right-camera-model", po::value(&opt.cam_file2), "Right Camera Model File")
("output-prefix", po::value(&opt.out_prefix), "Prefix for output filenames")
("extra_argument1", po::value(&opt.extra_arg1), "Extra Argument 1")
@@ -71,11 +71,6 @@ void vw::handle_arguments( int argc, char *argv[], Options& opt ) {
asp::check_command_line( argc, argv, opt, general_options,
positional, positional_desc, usage );
- if (!vm.count("left-input-image") || !vm.count("right-input-image") ||
- !vm.count("left-camera-model") )
- vw_throw( ArgumentErr() << "Missing all of the correct input files.\n\n"
- << usage << general_options );
-
// If the user hasn't specified a stereo session type, we take a
// guess here based on the file suffixes.
if (opt.stereo_session_string.empty()) {
Please sign in to comment.
Something went wrong with that request. Please try again.