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::cout << " -s3,--s3 Enables S3 mode"
|
||||
<< std::endl;
|
||||
std::cout << " -na,--name Unique name for S3 "
|
||||
"instance [Required]"
|
||||
<< std::endl;
|
||||
std::cout
|
||||
<< " -na,--name Unique name for S3 or Sia "
|
||||
"instance [Required]"
|
||||
<< std::endl;
|
||||
std::cout
|
||||
<< " -gc,--generate_config Generate initial configuration"
|
||||
<< 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;
|
||||
res = utils::cli::parse_string_option(
|
||||
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);
|
||||
if (unique_id.empty()) {
|
||||
std::cerr << "Name of S3 instance not provided" << std::endl;
|
||||
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{};
|
||||
|
@ -391,10 +391,9 @@ TEST(utils_path, absolute) {
|
||||
}
|
||||
|
||||
TEST(utils_path, absolute_can_resolve_path_variables) {
|
||||
std::string home{};
|
||||
|
||||
#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());
|
||||
#else // !defined(_WIN32)
|
||||
auto home = utils::path::absolute(utils::get_environment_variable("HOME"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user