Debugger: Add CliCommand::PrintUsage()

This commit is contained in:
Ingo Weinhold
2012-08-05 01:07:16 +02:00
parent 147d65c26d
commit a7580a8299
2 changed files with 13 additions and 0 deletions
@@ -6,6 +6,8 @@
#include "CliCommand.h"
#include <stdio.h>
CliCommand::CliCommand(const char* summary, const char* usage)
:
@@ -18,3 +20,12 @@ CliCommand::CliCommand(const char* summary, const char* usage)
CliCommand::~CliCommand()
{
}
void
CliCommand::PrintUsage(const char* commandName) const
{
printf("Usage: ");
printf(Usage(), commandName);
printf("\n");
}
@@ -21,6 +21,8 @@ public:
const char* Summary() const { return fSummary; }
const char* Usage() const { return fUsage; }
void PrintUsage(const char* commandName) const;
virtual void Execute(int argc, const char* const* argv,
CliContext& context) = 0;