refactor
This commit is contained in:
parent
28065c2c8e
commit
96c712ae9c
@ -72,7 +72,8 @@ auto main(int argc, char **argv) -> int {
|
||||
std::string remote_host;
|
||||
std::uint16_t remote_port{};
|
||||
std::string unique_id;
|
||||
if ((res == exit_code::success) && (prov == provider_type::remote)) {
|
||||
if (res == exit_code::success) {
|
||||
if (prov == provider_type::remote) {
|
||||
std::string data;
|
||||
res = utils::cli::parse_string_option(
|
||||
args, utils::cli::options::remote_mount_option, data);
|
||||
@ -89,20 +90,19 @@ auto main(int argc, char **argv) -> int {
|
||||
try {
|
||||
remote_port = utils::string::to_uint16(parts.at(1U));
|
||||
data_directory = utils::path::combine(
|
||||
data_directory.empty() ? app_config::default_data_directory(prov)
|
||||
data_directory.empty()
|
||||
? app_config::default_data_directory(prov)
|
||||
: data_directory,
|
||||
{utils::string::replace_copy(unique_id, ':', '_')});
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << (e.what() == nullptr ? "Unable to parse port" : e.what())
|
||||
std::cerr << (e.what() == nullptr ? "Unable to parse port"
|
||||
: e.what())
|
||||
<< std::endl;
|
||||
res = exit_code::invalid_syntax;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((res == exit_code::success) &&
|
||||
((prov == provider_type::s3) || (prov == provider_type::sia))) {
|
||||
} else if (((prov == provider_type::s3) || (prov == provider_type::sia))) {
|
||||
std::string data;
|
||||
res = utils::cli::parse_string_option(
|
||||
args, utils::cli::options::name_option, data);
|
||||
@ -127,6 +127,7 @@ auto main(int argc, char **argv) -> int {
|
||||
: utils::path::absolute(data_directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int mount_result{};
|
||||
if (res == exit_code::success) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user