From da222940ca61a38b24a877fe996e61e4fee6e24b Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 4 May 2016 19:39:46 +0200 Subject: [PATCH] Update copyright year in -h message Also make it nicer/easier (hopefully) to remember and to update it next time. --- CMakeLists.txt | 1 + src/common/commandline.cpp | 8 +++++++- src/dindexerConfig.h.in | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 645922c..cda05aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ if(DINDEXER_NATIVE_RELEASE) else() set(march_flag "") endif() +set(DINDEXER_COPYRIGHT_YEARS "2015,2016") set(DINDEXER_ACTIONS_PATH "${CMAKE_CURRENT_BINARY_DIR}/src" CACHE STRING "Actions search path") string(REGEX MATCH "[^/].*" ACTIONS_PATH_INSTALL "${DINDEXER_ACTIONS_PATH}") set(DB_OWNER_NAME "$ENV{USER}" CACHE STRING "Name that will be used as the DB owner name") diff --git a/src/common/commandline.cpp b/src/common/commandline.cpp index 4880a23..fdf48fa 100644 --- a/src/common/commandline.cpp +++ b/src/common/commandline.cpp @@ -19,9 +19,12 @@ #include "dindexerConfig.h" #include "helpers/lengthof.h" #include "helpers/stringize.h" +#include "helpers/infix_iterator.hpp" #include #include #include +#include +#include namespace po = boost::program_options; @@ -55,7 +58,10 @@ namespace dinlib { parStream << "*******************\n"; parStream << '\n'; #endif - parStream << PROGRAM_NAME << " Copyright (C) 2015 Michele Santullo\n"; + parStream << PROGRAM_NAME << " Copyright (C) "; + const uint32_t copyright_years[] = { COPYRIGHT_YEARS_LIST }; + std::copy(copyright_years, copyright_years + lengthof(copyright_years), infix_ostream_iterator(parStream, ", ")); + parStream << " Michele Santullo\n"; parStream << "This program comes with ABSOLUTELY NO WARRANTY.\n"; //for details type `show w'. parStream << "This is free software, and you are welcome to\n"; parStream << "redistribute it under certain conditions.\n"; //type `show c' for details. diff --git a/src/dindexerConfig.h.in b/src/dindexerConfig.h.in index df8743b..a7d7187 100644 --- a/src/dindexerConfig.h.in +++ b/src/dindexerConfig.h.in @@ -51,4 +51,6 @@ # define WITH_NICE_MEDIA_TYPES #endif +#define COPYRIGHT_YEARS_LIST @DINDEXER_COPYRIGHT_YEARS@ + #endif