9 #include <boost/program_options.hpp>
15 using namespace edmplugin;
20 using namespace boost::program_options;
22 static const char*
const kFilesOpt =
"files";
23 static const char*
const kFilesCommandOpt =
"files,f";
24 static const char*
const kAllFilesOpt =
"all_files";
25 static const char*
const kAllFilesCommandOpt =
"all_files,a";
26 static const char*
const kHelpOpt =
"help";
30 descString +=
" [options]";
31 descString +=
"\nAllowed options";
32 options_description desc(descString);
36 ,
"list the file from which a plugin will come")
38 ,
"list all the files to which a plugin is registered")
44 store(command_line_parser(argc,argv).
options(desc).
run(),vm);
46 }
catch(
const error& iException) {
56 bool printFiles =
false;
57 if(vm.count(kFilesOpt) ) {
61 bool printAllFiles =
false;
62 if(vm.count(kAllFilesOpt) ) {
67 int returnValue = EXIT_SUCCESS;
76 for (CatToInfos::const_iterator it = catToInfos.begin(), itEnd=catToInfos.end();
79 std::cout <<
"Category "<<it->first<<
":"<<std::endl;
81 for (edmplugin::PluginManager::Infos::const_iterator itInfo = it->second.begin(), itInfoEnd = it->second.end();
82 itInfo != itInfoEnd; ++itInfo)
85 if(pluginName != prevPluginName) {
88 std::cout <<
" "<<itInfo->loadable_.string()<<std::endl;
90 prevPluginName=pluginName;
92 else if(printAllFiles) {
93 std::cout <<
" "<<itInfo->loadable_.string()<<std::endl;
98 std::cerr <<
"Caught exception "<<iException.what()<<std::endl;
99 returnValue = EXIT_FAILURE;
const CategoryToInfos & categoryToInfos() const
static PluginManager & configure(const Config &)
PluginManager::Config config()
std::map< std::string, Infos > CategoryToInfos
static const char *const kHelpCommandOpt
static const char *const kHelpOpt
static PluginManager * get()