1/* 2 * Copyright 2012, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef CLI_COMMAND_H 6#define CLI_COMMAND_H 7 8 9#include <Referenceable.h> 10 11 12class CliContext; 13 14 15class CliCommand : public BReferenceable { 16public: 17 CliCommand(const char* summary, 18 const char* usage); 19 virtual ~CliCommand(); 20 21 const char* Summary() const { return fSummary; } 22 const char* Usage() const { return fUsage; } 23 24 void PrintUsage(const char* commandName) const; 25 26 virtual void Execute(int argc, const char* const* argv, 27 CliContext& context) = 0; 28 29protected: 30 const char* fSummary; 31 const char* fUsage; 32}; 33 34 35#endif // CLI_COMMAND_H 36