Address compiler warnings #10
This commit is contained in:
parent
60052081b4
commit
0716a58ff0
20
src/main.cpp
20
src/main.cpp
@ -56,11 +56,11 @@ auto main(int argc, char **argv) -> int {
|
||||
if (argc == 1) {
|
||||
argc++;
|
||||
static std::string cmd(argv[0U]);
|
||||
static std::vector<const char *> v({&cmd[0U], "-h"});
|
||||
argv = (char **)&v[0U];
|
||||
static std::vector<const char *> v({cmd.data(), "-h"});
|
||||
argv = (char **)v.data();
|
||||
}
|
||||
|
||||
auto pt = utils::cli::get_provider_type_from_args(argc, argv);
|
||||
auto prov = utils::cli::get_provider_type_from_args(argc, argv);
|
||||
|
||||
std::string data_directory;
|
||||
auto res = utils::cli::parse_string_option(
|
||||
@ -81,7 +81,7 @@ 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) && (pt == provider_type::remote)) {
|
||||
if ((res == exit_code::success) && (prov == provider_type::remote)) {
|
||||
std::string data;
|
||||
if ((res = utils::cli::parse_string_option(
|
||||
argc, argv, utils::cli::options::remote_mount_option, data)) ==
|
||||
@ -98,7 +98,7 @@ auto main(int argc, char **argv) -> int {
|
||||
try {
|
||||
remote_port = utils::string::to_uint16(parts[1U]);
|
||||
data_directory = utils::path::combine(
|
||||
data_directory.empty() ? app_config::default_data_directory(pt)
|
||||
data_directory.empty() ? app_config::default_data_directory(prov)
|
||||
: data_directory,
|
||||
{utils::string::replace_copy(unique_id, ':', '_')});
|
||||
} catch (const std::exception &e) {
|
||||
@ -111,7 +111,7 @@ auto main(int argc, char **argv) -> int {
|
||||
}
|
||||
|
||||
#ifdef REPERTORY_ENABLE_S3
|
||||
if ((res == exit_code::success) && (pt == provider_type::s3)) {
|
||||
if ((res == exit_code::success) && (prov == provider_type::s3)) {
|
||||
std::string data;
|
||||
if ((res = utils::cli::parse_string_option(argc, argv,
|
||||
utils::cli::options::name_option,
|
||||
@ -122,7 +122,7 @@ auto main(int argc, char **argv) -> int {
|
||||
res = exit_code::invalid_syntax;
|
||||
} else {
|
||||
data_directory = utils::path::combine(
|
||||
data_directory.empty() ? app_config::default_data_directory(pt)
|
||||
data_directory.empty() ? app_config::default_data_directory(prov)
|
||||
: data_directory,
|
||||
{unique_id});
|
||||
}
|
||||
@ -145,11 +145,11 @@ auto main(int argc, char **argv) -> int {
|
||||
idx++) {
|
||||
res = cli::actions::perform_action(
|
||||
utils::cli::options::option_list[idx], argc, argv, data_directory,
|
||||
pt, unique_id, user, password);
|
||||
prov, unique_id, user, password);
|
||||
}
|
||||
if (res == exit_code::option_not_found) {
|
||||
res = cli::actions::mount(argc, argv, data_directory, mount_result, pt,
|
||||
remote_host, remote_port, unique_id);
|
||||
res = cli::actions::mount(argc, argv, data_directory, mount_result,
|
||||
prov, remote_host, remote_port, unique_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user