[commands] Clang-tidy fixes

This commit is contained in:
Alexander Karatarakis 2018-04-07 02:58:30 -07:00
parent 627e91a08f
commit 8d343ce6df
5 changed files with 14 additions and 9 deletions

View File

@ -14,24 +14,28 @@ namespace vcpkg::Commands::Contact
return S_EMAIL; return S_EMAIL;
} }
static const CommandSwitch switches[] = {{"--survey", "Launch default browser to the current vcpkg survey"}}; static constexpr StringLiteral OPTION_SURVEY = "--survey";
static constexpr std::array<CommandSwitch, 1> SWITCHES = {{
{OPTION_SURVEY, "Launch default browser to the current vcpkg survey"},
}};
const CommandStructure COMMAND_STRUCTURE = { const CommandStructure COMMAND_STRUCTURE = {
Help::create_example_string("contact"), Help::create_example_string("contact"),
0, 0,
0, 0,
{switches, {}}, {SWITCHES, {}},
nullptr, nullptr,
}; };
void perform_and_exit(const VcpkgCmdArguments& args) void perform_and_exit(const VcpkgCmdArguments& args)
{ {
auto parsed_args = args.parse_arguments(COMMAND_STRUCTURE); const ParsedArguments parsed_args = args.parse_arguments(COMMAND_STRUCTURE);
if (Util::Sets::contains(parsed_args.switches, switches[0].name)) if (Util::Sets::contains(parsed_args.switches, SWITCHES[0].name))
{ {
auto maybe_now = Chrono::CTime::get_current_date_time(); auto maybe_now = Chrono::CTime::get_current_date_time();
if (auto p_now = maybe_now.get()) if (const auto p_now = maybe_now.get())
{ {
auto& fs = Files::get_real_filesystem(); auto& fs = Files::get_real_filesystem();
auto config = UserConfig::try_read_data(fs); auto config = UserConfig::try_read_data(fs);

View File

@ -93,7 +93,7 @@ namespace vcpkg::Commands::Edit
const std::vector<fs::path> from_registry = find_from_registry(); const std::vector<fs::path> from_registry = find_from_registry();
candidate_paths.insert(candidate_paths.end(), from_registry.cbegin(), from_registry.cend()); candidate_paths.insert(candidate_paths.end(), from_registry.cbegin(), from_registry.cend());
auto it = Util::find_if(candidate_paths, [&](const fs::path& p) { return fs.exists(p); }); const auto it = Util::find_if(candidate_paths, [&](const fs::path& p) { return fs.exists(p); });
if (it == candidate_paths.cend()) if (it == candidate_paths.cend())
{ {
System::println( System::println(

View File

@ -108,7 +108,7 @@ namespace vcpkg::Commands::Integrate
#if defined(_WIN32) #if defined(_WIN32)
static ElevationPromptChoice elevated_cmd_execute(const std::string& param) static ElevationPromptChoice elevated_cmd_execute(const std::string& param)
{ {
SHELLEXECUTEINFOW sh_ex_info = {0}; SHELLEXECUTEINFOW sh_ex_info{};
sh_ex_info.cbSize = sizeof(sh_ex_info); sh_ex_info.cbSize = sizeof(sh_ex_info);
sh_ex_info.fMask = SEE_MASK_NOCLOSEPROCESS; sh_ex_info.fMask = SEE_MASK_NOCLOSEPROCESS;
sh_ex_info.hwnd = nullptr; sh_ex_info.hwnd = nullptr;

View File

@ -10,7 +10,7 @@ namespace vcpkg::Commands::List
static constexpr StringLiteral OPTION_FULLDESC = static constexpr StringLiteral OPTION_FULLDESC =
"--x-full-desc"; // TODO: This should find a better home, eventually "--x-full-desc"; // TODO: This should find a better home, eventually
static void do_print(const StatusParagraph& pgh, bool full_desc) static void do_print(const StatusParagraph& pgh, const bool full_desc)
{ {
if (full_desc) if (full_desc)
{ {

View File

@ -144,7 +144,8 @@ namespace vcpkg::Commands::Upgrade
const Build::BuildPackageOptions install_plan_options = {Build::UseHeadVersion::NO, const Build::BuildPackageOptions install_plan_options = {Build::UseHeadVersion::NO,
Build::AllowDownloads::YES, Build::AllowDownloads::YES,
Build::CleanBuildtrees::NO, Build::CleanBuildtrees::NO,
Build::CleanPackages::NO}; Build::CleanPackages::NO,
Build::DownloadTool::BUILT_IN};
// Set build settings for all install actions // Set build settings for all install actions
for (auto&& action : plan) for (auto&& action : plan)