From 4b554f460579d73678828ef65dce89c3be35e42c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 19 May 2018 17:07:40 -0700 Subject: [PATCH] modules/console: Add ctx term cmd. --- modules/console.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/console.cc b/modules/console.cc index 0320318ba..2aeb29bb6 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -754,6 +754,29 @@ console_cmd__ctx__interrupt(opt &out, const string_view &line) return true; } +bool +console_cmd__ctx__term(opt &out, const string_view &line) +{ + const params param{line, " ", + { + "id", + }}; + + const uint64_t ctxid + { + param.at(0) + }; + + for(auto *const &ctx : ctx::ctxs) + if(id(*ctx) == ctxid) + { + terminate(*ctx); + break; + } + + return true; +} + bool console_cmd__ctx__list(opt &out, const string_view &line) {