";
bool web = _webCommands->count(name) != 0;
if( web ) ss << "";
ss << name;
if( web ) ss << "";
ss << " | \n";
ss << "";
if (isWriteCommandForConfigServer()) {
ss << "W ";
}
else {
ss << "R ";
}
if( slaveOk() )
ss << "S ";
if( adminOnly() )
ss << "A";
ss << " | ";
ss << "";
if( helpStr != "no help defined" ) {
const char *p = helpStr.c_str();
while( *p ) {
if( *p == '<' ) {
ss << "<";
p++; continue;
}
else if( *p == '{' )
ss << "";
else if( *p == '}' ) {
ss << "} ";
p++;
continue;
}
if( strncmp(p, "http:", 5) == 0 ) {
ss << "";
q = p;
if( startsWith(q, "http://www.mongodb.org/display/") )
q += 31;
while( *q && *q != ' ' && *q != '\n' ) {
ss << (*q == '+' ? ' ' : *q);
q++;
if( *q == '#' )
while( *q && *q != ' ' && *q != '\n' ) q++;
}
ss << "";
p = q;
continue;
}
if( *p == '\n' ) ss << " ";
else ss << *p;
p++;
}
}
ss << " | ";
ss << "
\n";
}
Command::Command(StringData _name, bool web, StringData oldName) : name(_name.toString()) {
// register ourself.
if ( _commands == 0 )
_commands = new map