aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2021-12-27 16:28:45 -0700
committerBen Burdette <bburdette@gmail.com>2021-12-27 16:28:45 -0700
commit6801a423fc9abdfd2cb7307f2970553bcfad089d (patch)
treed4bf48a4f83f939636d5afc96f51378a3aa436c4 /src/libcmd/repl.cc
parent2a66c120e66953bf8d6cf6866eb2783549527d40 (diff)
:d env
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 188bf75e4..3948ede02 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -402,7 +402,6 @@ StorePath NixRepl::getDerivationPath(Value & v) {
return drvPath;
}
-
bool NixRepl::processLine(string line)
{
if (line == "") return true;
@@ -441,7 +440,8 @@ bool NixRepl::processLine(string line)
<< " :doc <expr> Show documentation of a builtin function\n"
<< " :d <cmd> Debug mode commands\n"
<< " :d stack Show call stack\n"
- << " :d stack <int> Detail for step N\n"
+ // << " :d stack <int> Detail for stack level N\n"
+ << " :d env Show env stack\n"
<< " :d error Show current error\n";
}
@@ -466,17 +466,21 @@ bool NixRepl::processLine(string line)
}
}
}
-
-
+ } else if (arg == "env") {
+ std::cout << "env stack:" << std::endl;
+ auto iter = this->state->debugTraces.begin();
+ if (iter != this->state->debugTraces.end()) {
+ printStaticEnvBindings(iter->expr);
+ }
}
else if (arg == "error") {
- if (this->debugError) {
- showErrorInfo(std::cout, debugError->info(), true);
- }
- else
- {
- notice("error information not available");
- }
+ if (this->debugError) {
+ showErrorInfo(std::cout, debugError->info(), true);
+ }
+ else
+ {
+ notice("error information not available");
+ }
}
}