2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

Fix Console Help indentation

This commit is contained in:
2013-07-09 21:40:29 -04:00
parent dd35878465
commit 88dfd51000

View File

@ -123,11 +123,9 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
pfConsoleCmd *cmd;
pfConsoleCmdGroup *group, *subGrp;
const char *ptr;
static char string[ 512 ];
static char tempString[ 512 ];
uint32_t i;
/// Scan for subgroups. This can be an empty loop
group = pfConsoleCmdGroup::GetBaseGroup();
ptr = console_strtok( name, false );
@ -152,15 +150,13 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
// Print help for this group
if( group == pfConsoleCmdGroup::GetBaseGroup() )
strcpy( string, "Base commands and groups:" );
PrintFn("Base commands and groups:");
else
sprintf( string, "Group %s:", group->GetName() );
PrintFn( string );
PrintFn(plString::Format("Group %s:", group->GetName()).c_str());
PrintFn(" Subgroups:");
for( subGrp = group->GetFirstSubGroup(); subGrp != nil; subGrp = subGrp->GetNext() )
{
sprintf( string, " %s", subGrp->GetName() );
PrintFn( string );
PrintFn(plString::Format(" %s", subGrp).c_str());
}
PrintFn(" Commands:");
for( cmd = group->GetFirstCommand(); cmd != nil; cmd = cmd->GetNext() )
@ -171,8 +167,7 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
}
tempString[ i ] = 0;
sprintf( string, " %s: %s", cmd->GetName(), tempString );
PrintFn( string );
PrintFn(plString::Format(" %s: %s", cmd->GetName(), tempString).c_str());
}
return true;
@ -187,11 +182,9 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
}
/// That's it!
plStringStream ss;
ss << "\nHelp for the command " << cmd->GetName() << ":\n";
ss << "\\i" << cmd->GetHelp() << "\n";
ss << "\\iUsage: " << cmd->GetSignature();
PrintFn(ss.GetString().c_str());
PrintFn(plString::Format("\nHelp for the command %s:", cmd->GetName()).c_str());
PrintFn(plString::Format("\\i%s", cmd->GetHelp()).c_str());
PrintFn(plString::Format("\\iUsage: %s", cmd->GetSignature()).c_str());
return true;
}