From edfeacac8a8f08f3b022cc561cc992d5a12fcf51 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 2 Mar 2022 22:16:28 +0300 Subject: Add support for --stdout-format to bdep-status command --- bdep/types-parsers.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bdep/types-parsers.cxx') diff --git a/bdep/types-parsers.cxx b/bdep/types-parsers.cxx index 7707b3c..8f693fa 100644 --- a/bdep/types-parsers.cxx +++ b/bdep/types-parsers.cxx @@ -68,5 +68,22 @@ namespace bdep xs = true; parse_path (x, s); } + + void parser:: + parse (stdout_format& r, bool& xs, scanner& s) + { + const char* o (s.next ()); + + if (!s.more ()) + throw missing_value (o); + + string v (s.next ()); + + if (v == "lines") r = stdout_format::lines; + else if (v == "json") r = stdout_format::json; + else throw invalid_value (o, v); + + xs = true; + } } } -- cgit v1.1