From 390af63a73b7d91c3c0b37089e88027b4f46a39f Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 15 May 2023 22:38:18 +0300 Subject: Add support for interactive parameter for task request --- mod/types-parsers.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mod/types-parsers.cxx') diff --git a/mod/types-parsers.cxx b/mod/types-parsers.cxx index fd087bc..34a8bac 100644 --- a/mod/types-parsers.cxx +++ b/mod/types-parsers.cxx @@ -13,6 +13,7 @@ using namespace std; using namespace butl; using namespace bpkg; +using namespace bbot; using namespace web::xhtml; namespace brep @@ -114,6 +115,29 @@ namespace brep } } + // Parse interactive_mode. + // + void parser:: + parse (interactive_mode& x, bool& xs, scanner& s) + { + xs = true; + const char* o (s.next ()); + + if (!s.more ()) + throw missing_value (o); + + const string v (s.next ()); + + try + { + x = to_interactive_mode (v); + } + catch (const invalid_argument&) + { + throw invalid_value (o, v); + } + } + // Parse page_form. // void parser:: -- cgit v1.1