8 #include <boost/program_options.hpp>
13 using namespace edmplugin;
16 using namespace boost::program_options;
18 static const char*
const kFilesOpt =
"files";
19 static const char*
const kFilesCommandOpt =
"files,f";
20 static const char*
const kAllFilesOpt =
"all_files";
21 static const char*
const kAllFilesCommandOpt =
"all_files,a";
22 static const char*
const kHelpOpt =
"help";
26 descString +=
" [options]";
27 descString +=
"\nAllowed options";
28 options_description
desc(descString);
31 "list the file from which a plugin will come")(kAllFilesCommandOpt,
32 "list all the files to which a plugin is registered")
38 store(command_line_parser(argc, argv).
options(desc).
run(), vm);
40 }
catch (
const error& iException) {
50 bool printFiles =
false;
51 if (vm.count(kFilesOpt)) {
55 bool printAllFiles =
false;
56 if (vm.count(kAllFilesOpt)) {
61 int returnValue = EXIT_SUCCESS;
70 for (CatToInfos::const_iterator it = catToInfos.begin(), itEnd = catToInfos.end(); it != itEnd; ++it) {
71 std::cout <<
"Category " << it->first <<
":" << std::endl;
73 for (edmplugin::PluginManager::Infos::const_iterator itInfo = it->second.begin(), itInfoEnd = it->second.end();
77 if (pluginName != prevPluginName) {
78 std::cout <<
" " << pluginName << std::endl;
80 std::cout <<
" " << itInfo->loadable_.string() << std::endl;
82 prevPluginName = pluginName;
83 }
else if (printAllFiles) {
84 std::cout <<
" " << itInfo->loadable_.string() << std::endl;
89 std::cerr <<
"Caught exception " << iException.what() << std::endl;
90 returnValue = EXIT_FAILURE;
const CategoryToInfos & categoryToInfos() const
static PluginManager & configure(const Config &)
std::map< std::string, Infos > CategoryToInfos
PluginManager::Config config()
static const char *const kHelpCommandOpt
static const char *const kHelpOpt
static PluginManager * get()