aboutsummaryrefslogtreecommitdiff
path: root/bpkg/types-parsers.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/types-parsers.cxx')
-rw-r--r--bpkg/types-parsers.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/bpkg/types-parsers.cxx b/bpkg/types-parsers.cxx
index 9e97ccd..6a61a3d 100644
--- a/bpkg/types-parsers.cxx
+++ b/bpkg/types-parsers.cxx
@@ -47,5 +47,25 @@ namespace bpkg
xs = true;
parse_path (x, s);
}
+
+ void parser<auth>::
+ parse (auth& 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 == "none")
+ x = auth::none;
+ else if (v == "remote")
+ x = auth::remote;
+ else if (v == "all")
+ x = auth::all;
+ else
+ throw invalid_value (o, v);
+ }
}
}