nix --help: Show usage examples
This commit is contained in:
parent
1b0088ebb2
commit
69e3ffb076
3 changed files with 41 additions and 0 deletions
|
|
@ -11,6 +11,18 @@ struct Command : virtual Args
|
|||
virtual std::string name() = 0;
|
||||
virtual void prepare() { };
|
||||
virtual void run() = 0;
|
||||
|
||||
struct Example
|
||||
{
|
||||
std::string description;
|
||||
std::string command;
|
||||
};
|
||||
|
||||
typedef std::list<Example> Examples;
|
||||
|
||||
virtual Examples examples() { return Examples(); }
|
||||
|
||||
void printHelp(const string & programName, std::ostream & out) override;
|
||||
};
|
||||
|
||||
class Store;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue