about summary refs log tree commit diff
path: root/nix-repl.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-09T11·22+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-09-09T11·22+0200
commit4b33c2dd4cac95151ca5d99ceb3161fdb460ec0a (patch)
tree531c88b300328c5d0dd88b02c05c9acac151417b /nix-repl.cc
parente133e91410d9486e022a1bc0372b822152b6654e (diff)
Add help (:?)
Diffstat (limited to 'nix-repl.cc')
-rw-r--r--nix-repl.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/nix-repl.cc b/nix-repl.cc
index 9c22abbfac..72099f46e6 100644
--- a/nix-repl.cc
+++ b/nix-repl.cc
@@ -248,7 +248,19 @@ void NixRepl::processLine(string line)
 
     string command = string(line, 0, 2);
 
-    if (command == ":a") {
+    if (command == ":?") {
+        cout << "The following commands are available:\n"
+             << "\n"
+             << "  <expr>     Evaluate and print expression\n"
+             << "  :a <expr>  Add attributes from resulting set to scope\n"
+             << "  :b <expr>  Build derivation\n"
+             << "  :l <path>  Load Nix expression and add it to scope\n"
+             << "  :p <expr>  Evaluate and print expression recursively\n"
+             << "  :s <expr>  Build dependencies of derivation, then start nix-shell\n"
+             << "  :t <expr>  Describe result of evaluation\n";
+    }
+
+    else if (command == ":a") {
         Value v;
         evalString(string(line, 2), v);
         addAttrsToScope(v);