Skip to content

Commit

Permalink
Use fmtlib instead of boost::format.
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdafu committed May 22, 2018
1 parent acd4cef commit 75e5a78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ target_include_directories(neopg-tool PUBLIC
${BOTAN2_INCLUDE_DIRS}
${CLI11_INCLUDE_DIR}
${RANG_INCLUDE_DIR}
${SPDLOG_INCLUDE_DIR}
../include
)

Expand Down Expand Up @@ -269,6 +270,7 @@ target_include_directories(neopg-bin PRIVATE
${CLI11_INCLUDE_DIR}
${SPDLOG_INCLUDE_DIR}
${JSON_INCLUDE_DIR}
${SPDLOG_INCLUDE_DIR}
../include
)
target_compile_definitions(neopg-bin PRIVATE
Expand Down
6 changes: 4 additions & 2 deletions src/cli/packet_command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#include <CLI11.hpp>

#include <boost/format.hpp>
#include <spdlog/fmt/fmt.h>

#include <rang.hpp>

#include <iostream>

Expand Down Expand Up @@ -49,7 +51,7 @@ struct LegacyPacketSink : public RawPacketSink {
auto new_header = dynamic_cast<NewPacketHeader*>(header.get());

std::cout << "# off=" << header->m_offset
<< " ctb=" << (boost::format("%02x") % (int)(uint8_t)head[0])
<< " ctb=" << fmt::format("{:02x}", static_cast<int>((uint8_t)head[0]))
<< " tag=" << (int)header->type() << " hlen=" << head.length()
<< " plen=" << length << (new_header ? " new-ctb" : "") << "\n";
}
Expand Down
8 changes: 4 additions & 4 deletions src/neopg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

#include <iostream>

#include <spdlog/fmt/fmt.h>
#include <spdlog/spdlog.h>

#include <CLI11.hpp>
#include <rang.hpp>

#include <boost/algorithm/string/predicate.hpp>
#include <boost/format.hpp>
#include <boost/locale.hpp>

#include <curl/curl.h>
Expand Down Expand Up @@ -135,9 +136,8 @@ int main(int argc, char* argv[]) {
/* Translators, please add a second line saying "Report translation bugs to
<...>" with the address for translation bugs (typically your translation
team's web or email address). */
app.set_footer((boost::format(_("Report bugs to %s")) %
"https://github.com/das-labor/neopg")
.str());
app.set_footer(fmt::format(_("Report bugs to {}"),
"https://github.com/das-labor/neopg"));
// app.require_subcommand(1);
app.set_help_flag("--help", _("display help and exit"));
app.add_subcommand("help", _("display help and exit"))
Expand Down

0 comments on commit 75e5a78

Please sign in to comment.