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) {
|
if (argc == 1) {
|
||||||
argc++;
|
argc++;
|
||||||
static std::string cmd(argv[0U]);
|
static std::string cmd(argv[0U]);
|
||||||
static std::vector<const char *> v({&cmd[0U], "-h"});
|
static std::vector<const char *> v({cmd.data(), "-h"});
|
||||||
argv = (char **)&v[0U];
|
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;
|
std::string data_directory;
|
||||||
auto res = utils::cli::parse_string_option(
|
auto res = utils::cli::parse_string_option(
|
||||||
@ -81,7 +81,7 @@ auto main(int argc, char **argv) -> int {
|
|||||||
std::string remote_host;
|
std::string remote_host;
|
||||||
std::uint16_t remote_port{};
|
std::uint16_t remote_port{};
|
||||||
std::string unique_id;
|
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;
|
std::string data;
|
||||||
if ((res = utils::cli::parse_string_option(
|
if ((res = utils::cli::parse_string_option(
|
||||||
argc, argv, utils::cli::options::remote_mount_option, data)) ==
|
argc, argv, utils::cli::options::remote_mount_option, data)) ==
|
||||||
@ -98,7 +98,7 @@ auto main(int argc, char **argv) -> int {
|
|||||||
try {
|
try {
|
||||||
remote_port = utils::string::to_uint16(parts[1U]);
|
remote_port = utils::string::to_uint16(parts[1U]);
|
||||||
data_directory = utils::path::combine(
|
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,
|
: data_directory,
|
||||||
{utils::string::replace_copy(unique_id, ':', '_')});
|
{utils::string::replace_copy(unique_id, ':', '_')});
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
@ -111,7 +111,7 @@ auto main(int argc, char **argv) -> int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef REPERTORY_ENABLE_S3
|
#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;
|
std::string data;
|
||||||
if ((res = utils::cli::parse_string_option(argc, argv,
|
if ((res = utils::cli::parse_string_option(argc, argv,
|
||||||
utils::cli::options::name_option,
|
utils::cli::options::name_option,
|
||||||
@ -122,7 +122,7 @@ auto main(int argc, char **argv) -> int {
|
|||||||
res = exit_code::invalid_syntax;
|
res = exit_code::invalid_syntax;
|
||||||
} else {
|
} else {
|
||||||
data_directory = utils::path::combine(
|
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,
|
: data_directory,
|
||||||
{unique_id});
|
{unique_id});
|
||||||
}
|
}
|
||||||
@ -145,11 +145,11 @@ auto main(int argc, char **argv) -> int {
|
|||||||
idx++) {
|
idx++) {
|
||||||
res = cli::actions::perform_action(
|
res = cli::actions::perform_action(
|
||||||
utils::cli::options::option_list[idx], argc, argv, data_directory,
|
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) {
|
if (res == exit_code::option_not_found) {
|
||||||
res = cli::actions::mount(argc, argv, data_directory, mount_result, pt,
|
res = cli::actions::mount(argc, argv, data_directory, mount_result,
|
||||||
remote_host, remote_port, unique_id);
|
prov, remote_host, remote_port, unique_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user