TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Connection_Patcher Namespace Reference

Namespaces

 Helper
 

Functions

po::variables_map GetConsoleArguments (int argc, char **argv)
 

Function Documentation

po::variables_map Connection_Patcher::GetConsoleArguments ( int  argc,
char **  argv 
)
97  {
98  po::options_description all("Allowed options");
99  all.add_options()
100  ("help,h", "print usage message")
101  ("path", po::value<std::string>()->required(), "Path to the Wow.exe")
102  ;
103 
104  po::positional_options_description pos;
105  pos.add("path", 1);
106 
107  po::variables_map vm;
108  try
109  {
110  po::store(po::command_line_parser(argc, argv).options(all).positional(pos).run(), vm);
111  po::notify(vm);
112  }
113  catch (std::exception& e)
114  {
115  std::cerr << e.what() << "\n";
116  }
117 
118  if (vm.count("help"))
119  std::cout << all << "\n";
120 
121  if (!vm.count("path"))
122  throw std::invalid_argument("Wrong number of arguments: Missing client file.");
123 
124  return vm;
125  }
bool all(float x)
Definition: g3dmath.h:431

+ Here is the call graph for this function:

+ Here is the caller graph for this function: