OTB 7 and commandLineArgumentParser

Hello,

I don’t find the otbCommandLineArgumentParser.h in the OTB 7 release candidate. Was it replaced by something else ? I have a lot of small apps that used this library, so it would be really nice to maintain it in the new version.

Hello,

It has been removed in this merge request. This result from this discussion, in which we decided to remove some old modules from the library. In the library we replaced usage of this module by argv and argc

Cédric

thanks for the reply. I see that I arrived too late to discuss this merge request. For me it was really usefull to manage optional arguments and to document my applications, but I understand that loosing some weight can benefit to the community. I used argc and argv before, but I don’t know how to manage optional arguments with it. Do you manage the parameter parsing of the OTB application only based on argc and argv ? I guess that I should have a look there, but I tought that it was managed by the commandline parser. Are you using boost for that ?

In the ApplicationLauncherCommandLine executable (i.e. otbcli_myApplication) we use argv (and argc) to create the a vector of (std string) arguments.

This information (moduleName, keys, values) is then extracted with the load(vector<string>) method of otb::wrapper::CommandLineLauncher, which in turn uses the otb::wrapper::CommandLineParser class. See the code in this Module

The removed commandLineArgumentParser was not used in otb applications, it was only used in a few tests and c++ examples.

Cédric

Thank you for the details, I will update to the new CommandLineParser