diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-03-02 22:16:28 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-03-04 19:18:25 +0300 |
commit | edfeacac8a8f08f3b022cc561cc992d5a12fcf51 (patch) | |
tree | bc1c0d62b94716fa83114f05d9f6812d41c42e0a /bdep/types-parsers.cxx | |
parent | 48f4687510f9c7ad2b0c2baff3b14a181201f221 (diff) |
Add support for --stdout-format to bdep-status command
Diffstat (limited to 'bdep/types-parsers.cxx')
-rw-r--r-- | bdep/types-parsers.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
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<stdout_format>:: + 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; + } } } |