diff --git a/src/cli/handlers/handle_version.c b/src/cli/handlers/handle_version.c index d83efb5..2f78346 100644 --- a/src/cli/handlers/handle_version.c +++ b/src/cli/handlers/handle_version.c @@ -1,9 +1,22 @@ #include "ft_ping.h" +#include "version_gen.h" + +#include int cli_handle_version(const char *arg, t_ping_config *config) { (void)arg; (void)config; - return 1; + + printf("%s version %s\n", g_prog_name.name, PING_VERSION); + printf("Copyright (C) 2026 lohhiicccc\n"); + printf("License GPLv3+:"); + printf("GNU GPL version 3 or later \n"); + printf("This is free software: you are free to change and redistribute it.\n"); + printf("There is NO WARRANTY, to the extent permitted by law.\n"); + printf("\n"); + printf("Build: %s (commit %s)\n", PING_BUILD_DATE, PING_GIT_COMMIT); + + return -1; }