aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/types-parsers.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/types-parsers.cxx')
-rw-r--r--libbuild2/types-parsers.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/libbuild2/types-parsers.cxx b/libbuild2/types-parsers.cxx
index 86ce219..7b4a65d 100644
--- a/libbuild2/types-parsers.cxx
+++ b/libbuild2/types-parsers.cxx
@@ -3,8 +3,6 @@
#include <libbuild2/types-parsers.hxx>
-#include <libbuild2/b-options.hxx> // build2::build::cli namespace
-
namespace build2
{
namespace build
@@ -48,6 +46,24 @@ namespace build2
xs = true;
parse_path (x, s);
}
+
+ void parser<structured_result_format>::
+ parse (structured_result_format& x, bool& xs, scanner& s)
+ {
+ xs = true;
+ const char* o (s.next ());
+
+ if (!s.more ())
+ throw missing_value (o);
+
+ const string v (s.next ());
+ if (v == "lines")
+ x = structured_result_format::lines;
+ else if (v == "json")
+ x = structured_result_format::json;
+ else
+ throw invalid_value (o, v);
+ }
}
}
}