fixes
This commit is contained in:
parent
f932799efa
commit
8561278539
@ -38,9 +38,10 @@ template <typename drive> inline void help(std::vector<const char *> args) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
std::cout << " -s3,--s3 Enables S3 mode"
|
std::cout << " -s3,--s3 Enables S3 mode"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
std::cout << " -na,--name Unique name for S3 "
|
std::cout
|
||||||
"instance [Required]"
|
<< " -na,--name Unique name for S3 or Sia "
|
||||||
<< std::endl;
|
"instance [Required]"
|
||||||
|
<< std::endl;
|
||||||
std::cout
|
std::cout
|
||||||
<< " -gc,--generate_config Generate initial configuration"
|
<< " -gc,--generate_config Generate initial configuration"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -101,23 +101,29 @@ auto main(int argc, char **argv) -> int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((res == exit_code::success) && (prov == provider_type::s3)) {
|
if ((res == exit_code::success) &&
|
||||||
|
((prov == provider_type::s3) || (prov == provider_type::sia))) {
|
||||||
std::string data;
|
std::string data;
|
||||||
res = utils::cli::parse_string_option(
|
res = utils::cli::parse_string_option(
|
||||||
args, utils::cli::options::name_option, data);
|
args, utils::cli::options::name_option, data);
|
||||||
if (res == exit_code::success) {
|
if (res == exit_code::option_not_found && prov == provider_type::sia) {
|
||||||
|
unique_id = "default";
|
||||||
|
res = exit_code::success;
|
||||||
|
} else if (res == exit_code::success) {
|
||||||
unique_id = utils::string::trim(data);
|
unique_id = utils::string::trim(data);
|
||||||
if (unique_id.empty()) {
|
if (unique_id.empty()) {
|
||||||
std::cerr << "Name of S3 instance not provided" << std::endl;
|
std::cerr << "Name of S3 instance not provided" << std::endl;
|
||||||
res = exit_code::invalid_syntax;
|
res = exit_code::invalid_syntax;
|
||||||
} else {
|
|
||||||
data_directory =
|
|
||||||
data_directory.empty()
|
|
||||||
? utils::path::combine(app_config::default_data_directory(prov),
|
|
||||||
{unique_id})
|
|
||||||
: utils::path::absolute(data_directory);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (res == exit_code::success) {
|
||||||
|
data_directory =
|
||||||
|
data_directory.empty()
|
||||||
|
? utils::path::combine(app_config::default_data_directory(prov),
|
||||||
|
{unique_id})
|
||||||
|
: utils::path::absolute(data_directory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int mount_result{};
|
int mount_result{};
|
||||||
|
@ -391,10 +391,9 @@ TEST(utils_path, absolute) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(utils_path, absolute_can_resolve_path_variables) {
|
TEST(utils_path, absolute_can_resolve_path_variables) {
|
||||||
std::string home{};
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
auto home = utils::path::absolute(utils::get_environment_variable("USERPROFILE"));
|
auto home =
|
||||||
|
utils::path::absolute(utils::get_environment_variable("USERPROFILE"));
|
||||||
EXPECT_STREQ(home.c_str(), utils::path::absolute("%USERPROFILE%").c_str());
|
EXPECT_STREQ(home.c_str(), utils::path::absolute("%USERPROFILE%").c_str());
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
auto home = utils::path::absolute(utils::get_environment_variable("HOME"));
|
auto home = utils::path::absolute(utils::get_environment_variable("HOME"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user