mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Add new extended version CLI argument: "pihole -vv" listing also the versions of dnsmasq and LUA (if embedded)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -165,6 +165,7 @@ if(STATIC STREQUAL "true")
|
||||
target_link_libraries(pihole-FTL -static-libgcc -static -static-pie)
|
||||
endif()
|
||||
target_compile_options(pihole-FTL PRIVATE ${EXTRAWARN})
|
||||
target_compile_definitions(pihole-FTL PRIVATE DNSMASQ_VERSION=\"${DNSMASQ_VERSION}\")
|
||||
target_include_directories(pihole-FTL PRIVATE ${PROJECT_SOURCE_DIR}/src)
|
||||
add_dependencies(pihole-FTL gen_version)
|
||||
|
||||
@@ -184,6 +185,7 @@ target_link_libraries(pihole-FTL rt Threads::Threads ${HOGWEED} ${GMP} ${NETTLE}
|
||||
# for LUASCRIPT support we add liblua, libdl (lookforfunc) and libm
|
||||
# Only liblua is linked statically as linking libm and libdl statically is discouraged
|
||||
if(FTL_LUA STREQUAL "true")
|
||||
target_compile_definitions(pihole-FTL PRIVATE FTL_LUA)
|
||||
find_library(LUA liblua${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
find_library(DL dl)
|
||||
find_library(MATH m)
|
||||
|
||||
+23
@@ -8,6 +8,11 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
// DNSMASQ COPYRIGHT
|
||||
#define FTLDNS
|
||||
#include "dnsmasq/dnsmasq.h"
|
||||
#undef __USE_XOPEN
|
||||
|
||||
#include "FTL.h"
|
||||
#include "args.h"
|
||||
#include "version.h"
|
||||
@@ -17,6 +22,11 @@
|
||||
// global variable killed
|
||||
#include "signals.h"
|
||||
|
||||
// LUA version
|
||||
#ifdef FTL_LUA
|
||||
#include <lua.h>
|
||||
#endif
|
||||
|
||||
static bool debug = false;
|
||||
bool daemonmode = true;
|
||||
int argc_dnsmasq = 0;
|
||||
@@ -129,6 +139,18 @@ void parse_args(int argc, char* argv[])
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if(strcmp(argv[i], "-vv") == 0) // Extended version
|
||||
{
|
||||
printf("Pi-hole FTL: %s\n", get_FTL_version());
|
||||
printf("dnsmasq: "DNSMASQ_VERSION" "COPYRIGHT"\n");
|
||||
#ifdef FTL_LUA
|
||||
printf("LUA: "LUA_COPYRIGHT"\n");
|
||||
#else
|
||||
printf("LUA: --- (no LUA embedded)\n");
|
||||
#endif
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
if(strcmp(argv[i], "-t") == 0 ||
|
||||
strcmp(argv[i], "tag") == 0)
|
||||
{
|
||||
@@ -163,6 +185,7 @@ void parse_args(int argc, char* argv[])
|
||||
printf("\t test Don't start pihole-FTL but\n");
|
||||
printf("\t instead quit immediately\n");
|
||||
printf("\t-v, version Return version\n");
|
||||
printf("\t-vv Return extended version\n");
|
||||
printf("\t-t, tag Return git tag\n");
|
||||
printf("\t-b, branch Return git branch\n");
|
||||
printf("\t-f, no-daemon Don't go into daemon mode\n");
|
||||
|
||||
Reference in New Issue
Block a user