[commands] Clang-tidy fixes
MODIFY
src/vcpkg/commands.contact.cpp
src/vcpkg/commands.contact.cpp
@@ -14,24 +14,28 @@ namespace vcpkg::Commands::Contact
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 = {
Help::create_example_string("contact"),
0,
0,
- {switches, {}},
+ {SWITCHES, {}},
nullptr,
};
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();
- if (auto p_now = maybe_now.get())
+ if (const auto p_now = maybe_now.get())
{
auto& fs = Files::get_real_filesystem();
auto config = UserConfig::try_read_data(fs);

MODIFY
src/vcpkg/commands.edit.cpp
src/vcpkg/commands.edit.cpp
@@ -93,7 +93,7 @@ namespace vcpkg::Commands::Edit
const std::vector<fs::path> from_registry = find_from_registry();
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())
{
System::println(

MODIFY
src/vcpkg/commands.integrate.cpp
src/vcpkg/commands.integrate.cpp
@@ -108,7 +108,7 @@ namespace vcpkg::Commands::Integrate
#if defined(_WIN32)
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.fMask = SEE_MASK_NOCLOSEPROCESS;
sh_ex_info.hwnd = nullptr;

MODIFY
src/vcpkg/commands.list.cpp
src/vcpkg/commands.list.cpp
@@ -10,7 +10,7 @@ namespace vcpkg::Commands::List
static constexpr StringLiteral OPTION_FULLDESC =
"--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)
{

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

[commands] Clang-tidy fixes