aboutsummaryrefslogtreecommitdiff
path: root/bdep/types-parsers.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-07-09 09:48:07 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-27 14:23:07 +0300
commit07fdebdbb02fde71d6e656ddd46b967347417502 (patch)
tree594c2f352499aaac0756e3071a4b7ce2aee0fd34 /bdep/types-parsers.cxx
parent8a87a8bc08f0d692f53a0373da3a0a959de13e52 (diff)
Implement publish command for publishing packages to archive repositories
Diffstat (limited to 'bdep/types-parsers.cxx')
-rw-r--r--bdep/types-parsers.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/bdep/types-parsers.cxx b/bdep/types-parsers.cxx
index 6b92d8e..c93424a 100644
--- a/bdep/types-parsers.cxx
+++ b/bdep/types-parsers.cxx
@@ -10,6 +10,28 @@ namespace bdep
{
namespace cli
{
+ void parser<url>::
+ parse (url& x, bool& xs, scanner& s)
+ {
+ const char* o (s.next ());
+
+ if (!s.more ())
+ throw missing_value (o);
+
+ const char* v (s.next ());
+
+ try
+ {
+ x = url (v);
+ }
+ catch (const invalid_argument& e)
+ {
+ throw invalid_value (o, v, e.what ());
+ }
+
+ xs = true;
+ }
+
template <typename T>
static void
parse_path (T& x, scanner& s)