Skip to content

Commit 770083d

Browse files
authored
Merge pull request #2217 from joto/version-without-timestamp
Do not print timestamp before the version when --version is used
2 parents b2b5cc7 + 2449b29 commit 770083d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/command-line-parser.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ void check_options_expire(options_t *options) {
238238

239239
void print_version()
240240
{
241+
fmt::print(stderr, "osm2pgsql version {}", get_osm2pgsql_version());
241242
fmt::print(stderr, "Build: {}\n", get_build_type());
242243
fmt::print(stderr, "Compiled using the following library versions:\n");
243244
fmt::print(stderr, "Libosmium {}\n", LIBOSMIUM_VERSION_STRING);
@@ -609,17 +610,17 @@ options_t parse_command_line(int argc, char *argv[])
609610
return options;
610611
}
611612

613+
if (app.want_version()) {
614+
options.command = command_t::version;
615+
return options;
616+
}
617+
612618
log_info("osm2pgsql version {}", get_osm2pgsql_version());
613619

614620
if (verbose) {
615621
get_logger().set_level(log_level::debug);
616622
}
617623

618-
if (app.want_version()) {
619-
options.command = command_t::version;
620-
return options;
621-
}
622-
623624
if (options.append && app.count("--create")) {
624625
throw std::runtime_error{"--append and --create options can not be "
625626
"used at the same time!"};

0 commit comments

Comments
 (0)