src/tools/lvr2_scanproject_parser/Options.cpp
Go to the documentation of this file.
1 
28 /*
29  * Options.cpp
30  *
31  * Created on: Nov 21, 2010
32  * Author: Thomas Wiemann
33  */
34 
35 #include "Options.hpp"
36 
38 {
39 
40 Options::Options(int argc, char** argv) : m_descr("Supported options")
41 {
42 
43  // Create option descriptions
44 
45  m_descr.add_options()
46  ("help", "Produce help message")
47  ("inputDir", value<string>(), "Root of the raw data.")
48  ("outputDir", value<string>()->default_value("./"), "HDF5 file is written here.")
49  ("outputFile", value<string>()->default_value("data.h5"), "HDF5 file name.");
50 
51  // Parse command line and generate variables map
52  positional_options_description p;
53  p.add("inputDir", 1);
54  store(command_line_parser(argc, argv).options(m_descr).positional(p).run(), m_variables);
55  notify(m_variables);
56 
57  if (m_variables.count("help"))
58  {
59  ::std::cout << m_descr << ::std::endl;
60  exit(-1);
61  }
62  else if (!m_variables.count("inputDir"))
63  {
64  std::cout << "Error: You must specify an input directory." << std::endl;
65  std::cout << std::endl;
66  std::cout << m_descr << std::endl;
67  exit(-1);
68  }
69 }
70 
72 {
73  // TODO Auto-generated destructor stub
74 }
75 
76 } // namespace scanproject_parser
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
variables_map m_variables
The internally used variable map.
const kaboom::Options * options
options_description m_descr
The internally used option description.
SharedPointer p
char ** argv


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08