Skip to content

Commit

Permalink
feat: add build id to asrestore version command
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-spike committed Mar 1, 2024
1 parent 30c99d4 commit cc0c4df
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/backup_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extern char *aerospike_client_version;
// Forward Declarations.
//

static void print_version(void);
static void print_version();
static void usage(const char *name);

//==========================================================
Expand Down
31 changes: 25 additions & 6 deletions src/restore_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern char *aerospike_client_version;
// Forward Declarations.
//

static void print_version(void);
static void print_version();
static void usage(const char* name);

//==========================================================
Expand Down Expand Up @@ -1057,12 +1057,31 @@ restore_config_from_cloud(const restore_config_t* conf)
* Print the tool's version information.
*/
static void
print_version(void)
print_version()
{
fprintf(stdout, "Aerospike Restore 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 Restore\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 cc0c4df

Please sign in to comment.