diff --git a/src/commands/CmdContext.cpp b/src/commands/CmdContext.cpp index 367cc6eff..1d533d3c0 100644 --- a/src/commands/CmdContext.cpp +++ b/src/commands/CmdContext.cpp @@ -64,6 +64,8 @@ int CmdContext::execute (std::string& output) rc = deleteContext(words, out); else if (subcommand == "list") rc = listContexts(words, out); + else if (subcommand == "none") + rc = unsetContext(words, out); else rc = setContext(words, out); } @@ -229,6 +231,24 @@ int CmdContext::setContext (std::vector & words, std::stringstream& return 0; } +//////////////////////////////////////////////////////////////////////////////// +int CmdContext::unsetContext (std::vector & words, std::stringstream& out) +{ + // task context none + int rc = 0; + int status = CmdConfig::unsetConfigVariable("context", false); + + if (status == 0) + out << "Context unset." << "\n"; + else + { + out << "Context not unset." << "\n"; + rc = 1; + } + + return rc; +} + //////////////////////////////////////////////////////////////////////////////// CmdCompletionContext::CmdCompletionContext () { diff --git a/src/commands/CmdContext.h b/src/commands/CmdContext.h index c1ef7ab8f..2a35029b8 100644 --- a/src/commands/CmdContext.h +++ b/src/commands/CmdContext.h @@ -41,6 +41,7 @@ public: int deleteContext (std::vector & words, std::stringstream& out); int listContexts (std::vector & words, std::stringstream& out); int setContext (std::vector & words, std::stringstream& out); + int unsetContext (std::vector & words, std::stringstream& out); }; class CmdCompletionContext : public Command