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 12 class CliContext; 13 14 15 class CliCommand : public BReferenceable { 16 public: 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 29 protected: 30 const char* fSummary; 31 const char* fUsage; 32 }; 33 34 35 #endif // CLI_COMMAND_H 36