MCPcopy Create free account
hub / github.com/PDAL/PDAL / doSwitches

Method doSwitches

pdal/Kernel.cpp:173–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173bool Kernel::doSwitches(const StringList& cmdArgs, ProgramArgs& args)
174{
175 StringList stringArgs = extractStageOptions(cmdArgs);
176
177 try
178 {
179 bool help;
180
181 // parseSimple allows us to scan for the help option without
182 // raising exception about missing arguments and so on.
183 // It also removes consumed args from the arg list, so for now,
184 // parse a copy that will be ignored by parse().
185 ProgramArgs hargs;
186 hargs.add("help,h", "Print help message", help);
187 hargs.parseSimple(stringArgs);
188 if (help)
189 return false;
190
191 addBasicSwitches(args);
192 addSwitches(args);
193 args.parse(stringArgs);
194 }
195 catch (arg_error& e)
196 {
197 throw pdal_error(getName() + ": " + e.what());
198 }
199 return true;
200}
201
202
203int Kernel::doStartup()

Callers

nothing calls this directly

Calls 6

addSwitchesFunction · 0.85
parseSimpleMethod · 0.80
getNameFunction · 0.50
addMethod · 0.45
parseMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected