Skip to content

Commit e92d650

Browse files
committed
replaced std::cout with fmt::print
1 parent ac9c4c3 commit e92d650

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

src/main.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include <functional>
2-
#include <iostream>
3-
#include <string>
41
#include "include/version.hpp"
52
#include <docopt/docopt.h>
3+
#include <functional>
4+
#include <iostream>
65
#include <spdlog/spdlog.h>
6+
#include <string>
77

88
static constexpr auto USAGE =
99
R"(Naval Fate.
@@ -30,14 +30,24 @@ int main(int argc, const char **argv)
3030
Minor {}
3131
Patch {}
3232
Git Hash {}
33-
)", Version::Major, Version::Minor, Version::Patch, Version::GitHash);
33+
)",
34+
Version::Major,
35+
Version::Minor,
36+
Version::Patch,
37+
Version::GitHash);
3438

3539
std::map<std::string, docopt::value> args = docopt::docopt(USAGE,
3640
{ std::next(argv), std::next(argv, argc) },
3741
true,// show help if requested
3842
"Naval Fate 2.0");// version string
3943

40-
for (auto const &arg : args) { std::cout << arg.first << arg.second << std::endl; }
44+
for (auto const &arg : args) {
45+
fmt::print(R"(
46+
{} {}
47+
)",
48+
arg.first,
49+
arg.second.asString());
50+
}
4151

4252
// Use the default logger (stdout, multi-threaded, colored)
4353
spdlog::info("Hello, {}!", "World");

src/sml/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include "states.h"
1010
#include <boost/sml.hpp>
1111
#include <chrono>
12-
#include <spdlog/sinks/stdout_color_sinks.h>
13-
#include <spdlog/spdlog.h>
1412
#include <thread>
1513

1614
using namespace std::chrono_literals;

templates/version.hpp.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#pragma once
2+
#include <cstdint>
3+
#include <string_view>
24

35
struct Version
46
{

0 commit comments

Comments
 (0)