*/
#include "gromacs/commandline/cmdlinehelpmodule.h"
-#include <algorithm>
#include <string>
#include <vector>
{
const std::string &tag(module->first);
std::string displayName(tag);
- std::replace(displayName.begin(), displayName.end(), '-', ' ');
+ // TODO: This does not work if the binary name would contain a dash,
+ // but that is not currently the case.
+ size_t dashPos = displayName.find('-');
+ GMX_RELEASE_ASSERT(dashPos != std::string::npos,
+ "There should always be at least one dash in the tag");
+ displayName[dashPos] = ' ';
indexFile_->writeLine(formatString("<a href=\"%s.html\">%s</a> - %s<br>",
tag.c_str(), displayName.c_str(),
module->second));
{
const char *const moduleName = module->first.c_str();
std::string tag(formatString("%s-%s", program, moduleName));
- std::string displayName(tag);
- std::replace(displayName.begin(), displayName.end(), '-', ' ');
+ std::string displayName(formatString("%s %s", program, moduleName));
exporter->exportModuleHelp(*module->second, tag, displayName);
}
}
helpModule_(NULL), singleModule_(NULL),
bQuiet_(false)
{
+ GMX_RELEASE_ASSERT(binaryName_.find('-') == std::string::npos,
+ "Help export does not currently work with binary names with dashes");
}
void CommandLineModuleManager::Impl::addModule(CommandLineModulePointer module)