Skip to content

Commit

Permalink
Merge pull request #1095 from PDAL/help-link
Browse files Browse the repository at this point in the history
Output help link in help print outs #1094
  • Loading branch information
hobu committed Jan 30, 2016
2 parents 2f220f5 + 96085c4 commit 3c6d392
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/pdal.cpp
Expand Up @@ -139,7 +139,8 @@ void outputOptions(std::string const& n)
return;
}

std::cout << n << std::endl;
std::string link = PluginManager::link(n);
std::cout << n << " -- " << link << std::endl;
std::cout << headline << std::endl;

std::vector<Option> options = s->getDefaultOptions().getOptions();
Expand Down
2 changes: 2 additions & 0 deletions include/pdal/PluginManager.hpp
Expand Up @@ -70,6 +70,7 @@ class PDAL_DLL PluginManager
~PluginManager();

static std::string description(const std::string& name);
static std::string link(const std::string& name);
static bool registerObject(const std::string& name,
const PF_RegisterParams *params);
static bool initializePlugin(PF_InitFunc initFunc);
Expand All @@ -93,6 +94,7 @@ class PDAL_DLL PluginManager
void l_loadAll(int type);
StringList l_names(int typeMask);
std::string l_description(const std::string& name);
std::string l_link(const std::string& name);

DynamicLibrary *loadLibrary(const std::string& path,
std::string& errorString);
Expand Down
17 changes: 17 additions & 0 deletions src/PluginManager.cpp
Expand Up @@ -150,6 +150,23 @@ StringList PluginManager::l_names(int typeMask)
return l;
}

std::string PluginManager::link(const std::string& name)
{
return s_instance.l_link(name);
}


std::string PluginManager::l_link(const std::string& name)
{
std::string link;

std::lock_guard<std::mutex> lock(m_mutex);
auto ei = m_plugins.find(name);
if (ei != m_plugins.end())
link= ei->second.link;
return link;
}


std::string PluginManager::description(const std::string& name)
{
Expand Down

0 comments on commit 3c6d392

Please sign in to comment.