@@ -75,16 +75,29 @@ std::string get_jemalloc_version() {
75
75
}
76
76
#endif
77
77
78
- } // namespace
79
-
80
- std::string tool_header (std::string_view tool_name, std::string_view extra_info,
81
- extra_deps_fn const & extra_deps) {
78
+ std::string
79
+ tool_header_impl (std::string_view tool_name, std::string_view extra_info = {}) {
82
80
std::string date;
83
81
84
82
if (DWARFS_GIT_DATE) {
85
83
date = fmt::format (" [{}]" , DWARFS_GIT_DATE);
86
84
}
87
85
86
+ return fmt::format (
87
+ // clang-format off
88
+ R"( ___ ___ ___)" " \n "
89
+ R"( | \__ __ ____ _ _ _| __/ __| Deduplicating Warp-speed)" " \n "
90
+ R"( | |) \ V V / _` | '_| _|\__ \ Advanced Read-only File System)" " \n "
91
+ R"( |___/ \_/\_/\__,_|_| |_| |___/ by Marcus Holland-Moritz)" " \n\n "
92
+ // clang-format on
93
+ " {} ({}{}{})\n built for {}\n\n " ,
94
+ tool_name, DWARFS_GIT_ID, date, extra_info, DWARFS_BUILD_ID);
95
+ }
96
+
97
+ } // namespace
98
+
99
+ std::string tool_header (std::string_view tool_name, std::string_view extra_info,
100
+ extra_deps_fn const & extra_deps) {
88
101
library_dependencies deps;
89
102
deps.add_common_libraries ();
90
103
@@ -96,16 +109,11 @@ std::string tool_header(std::string_view tool_name, std::string_view extra_info,
96
109
extra_deps (deps);
97
110
}
98
111
99
- return fmt::format (
100
- // clang-format off
101
- R"( ___ ___ ___)" " \n "
102
- R"( | \__ __ ____ _ _ _| __/ __| Deduplicating Warp-speed)" " \n "
103
- R"( | |) \ V V / _` | '_| _|\__ \ Advanced Read-only File System)" " \n "
104
- R"( |___/ \_/\_/\__,_|_| |_| |___/ by Marcus Holland-Moritz)" " \n\n "
105
- // clang-format on
106
- " {} ({}{}{})\n built for {}\n\n {}" ,
107
- tool_name, DWARFS_GIT_ID, date, extra_info, DWARFS_BUILD_ID,
108
- deps.as_string ());
112
+ return tool_header_impl (tool_name, extra_info) + deps.as_string () + " \n\n " ;
113
+ }
114
+
115
+ std::string tool_header_nodeps (std::string_view tool_name) {
116
+ return tool_header_impl (tool_name);
109
117
}
110
118
111
119
void add_common_options (po::options_description& opts,
0 commit comments