libcmd/repl: factor inDebugger
The completions for debug commands is purposefully left out because it is going to go away in the next changes. Change-Id: Ibc78b7587de3f15857bb09a3a0732334693ad550 Signed-off-by: Raito Bezarius <raito@lix.systems>
This commit is contained in:
+6
-1
@@ -150,6 +150,11 @@ struct NixRepl
|
||||
StorePath getDerivationPath(Value & v);
|
||||
ProcessLineResult processLine(std::string line);
|
||||
|
||||
bool inDebugger() const
|
||||
{
|
||||
return evaluator.debug && evaluator.debug->inDebugger;
|
||||
}
|
||||
|
||||
void loadFile(const Path & path);
|
||||
void loadFlake(const std::string & flakeRef);
|
||||
void loadFiles();
|
||||
@@ -292,7 +297,7 @@ ReplExitStatus NixRepl::mainLoop()
|
||||
{
|
||||
if (isFirstRepl) {
|
||||
std::string_view debuggerNotice = "";
|
||||
if (evaluator.debug && evaluator.debug->inDebugger) {
|
||||
if (inDebugger()) {
|
||||
debuggerNotice = " debugger";
|
||||
}
|
||||
notice("Lix %1%%2%\nType :? for help.", Uncolored(nixVersion), debuggerNotice);
|
||||
|
||||
Reference in New Issue
Block a user