19 #include <boost/program_options.hpp>
27 inline namespace Services {
43 namespace po = boost::program_options;
46 po::options_description options{};
47 options.add_options()(
"host", po::value<string>(),
"Hosting solution: iRODS or WebDAV (case insensitive)")(
48 "host-url", po::value<string>()->default_value(
""),
49 "Host URL if needed")(
"user", po::value<string>()->default_value(
""),
"User name if needed")(
50 "password", po::value<string>()->default_value(
""),
"Password if needed")(
51 "overwrite", po::value<string>()->default_value(
"no"),
"Allow overwriting local files if they already exist")(
52 "distant-workspace", po::value<string>(),
"Path to distant repository workspace")(
53 "local-workspace", po::value<string>(),
54 "Path to local repository workspace")(
"tries", po::value<int>()->default_value(4),
"Number of download tries");
62 po::store(po::parse_config_file<char>(abs_path.c_str(), options), vm);
70 hostUrl = vm[
"host-url"].as<
string>();
71 user = vm[
"user"].as<
string>();
72 password = vm[
"password"].as<
string>();
76 tries =
static_cast<size_t>(vm[
"tries"].as<
int>());
80 const string uncased =
lower(name);
81 if (uncased ==
"irods") {
83 }
else if (uncased ==
"webdav") {
94 const vector<string> overwrite_allowed_options = {
"true",
"yes",
"y"};
95 const vector<string> overwrite_forbidden_options = {
"false",
"no",
"n"};
97 string uncased =
lower(policy);
100 }
else if (
valueIsListed(uncased, overwrite_forbidden_options)) {