Skip to content

Commit

Permalink
feat: TOOLS-2842 add build to version output
Browse files Browse the repository at this point in the history
  • Loading branch information
jdogmcsteezy committed Feb 10, 2024
1 parent 48f591b commit 30c99d4
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/backup_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,12 +1244,31 @@ backup_config_allow_uncovered_partitions(const backup_config_t* conf)
* Print the tool's version information.
*/
static void
print_version(void)
print_version()
{
fprintf(stdout, "Aerospike Backup Utility\n");
fprintf(stdout, "Version %s\n", TOOL_VERSION);
fprintf(stdout, "C Client Version %s\n", aerospike_client_version);
fprintf(stdout, "Copyright 2015-2021 Aerospike. All rights reserved.\n");
char* build = NULL;
char* version_cpy = strdup(TOOL_VERSION);
char* token = strtok(version_cpy, "-");
char* version = token;

token = strtok(NULL, "-");

while (token != NULL) {
token = strtok(NULL, "-");

if (token != NULL) {
build = token;
}
}

fprintf(stdout, "Aerospike Backup\n");
fprintf(stdout, "Version %s\n", version);

if (build != NULL) {
fprintf(stdout, "Build %s\n", build);
}

free(version_cpy);
}

/*
Expand Down

0 comments on commit 30c99d4

Please sign in to comment.