about summary refs log tree commit diff
path: root/src/nix/command.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-21T12·58+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-21T12·58+0200
commit69e3ffb076931aba73b5fcc41f5264f5f62c5ce9 (patch)
treef01268866200955342848abb27f044c17359ca6b /src/nix/command.hh
parent1b0088ebb226ab80c91b54c201cc70204b976310 (diff)
nix --help: Show usage examples
Diffstat (limited to 'src/nix/command.hh')
-rw-r--r--src/nix/command.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nix/command.hh b/src/nix/command.hh
index a6adb5f65491..34affc43d96e 100644
--- a/src/nix/command.hh
+++ b/src/nix/command.hh
@@ -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;