From 761906406ec6713ae8b47c1a1563a3b77aeeb20c Mon Sep 17 00:00:00 2001 From: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Date: Tue, 27 Feb 2024 10:52:11 -0800 Subject: [PATCH] Style tweaks (#916) --- src/Cmd/Add.cc | 58 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/src/Cmd/Add.cc b/src/Cmd/Add.cc index fb967ba50..36442f77b 100644 --- a/src/Cmd/Add.cc +++ b/src/Cmd/Add.cc @@ -139,7 +139,6 @@ addDependencyToManifest( ofs << toml::format(data); logger::info("Added", "to the poac.toml"); - return EXIT_SUCCESS; } @@ -159,26 +158,45 @@ addMain(const std::span args) { String rev; String branch; + // clang-format off HashMap< - StringRef, - Fn(decltype(args)::iterator&, decltype(args)::iterator)>> - handlers = { - { "--sys", - [&](auto&, auto) { - isSystemDependency = true; - return None; - } }, - { "--version", [&](auto& itr, const auto end - ) { return handleNextArg(itr, end, version); } }, - { "-v", [&](auto& itr, const auto end - ) { return handleNextArg(itr, end, version); } }, - { "--tag", [&](auto& itr, const auto end - ) { return handleNextArg(itr, end, tag); } }, - { "--rev", [&](auto& itr, const auto end - ) { return handleNextArg(itr, end, rev); } }, - { "--branch", [&](auto& itr, const auto end - ) { return handleNextArg(itr, end, branch); } }, - }; + StringRef, + Fn(decltype(args)::iterator&, decltype(args)::iterator)> + > + handlers = { + { + "--sys", [&](auto&, auto) { + isSystemDependency = true; + return None; + } + }, + { + "--version", [&](auto& itr, const auto end) { + return handleNextArg(itr, end, version); + } + }, + { + "-v", [&](auto& itr, const auto end) { + return handleNextArg(itr, end, version); + } + }, + { + "--tag", [&](auto& itr, const auto end) { + return handleNextArg(itr, end, tag); + } + }, + { + "--rev", [&](auto& itr, const auto end) { + return handleNextArg(itr, end, rev); + } + }, + { + "--branch", [&](auto& itr, const auto end) { + return handleNextArg(itr, end, branch); + } + }, + }; + // clang-format on for (auto itr = args.begin(); itr != args.end(); ++itr) { if (const auto res = Cli::handleGlobalOpts(itr, args.end(), "add")) {