Add --version flag to both client and server binaries #52

Closed
opened 2026-07-20 17:14:08 +02:00 by TapTap · 0 comments
Owner

Description

Neither the client (src/client/client_cli.c) nor the server (src/server/server.c) supports a --version flag. The PROTOCOL_VERSION macro exists in src/shared/config.h as 1.2.0, but there is no way for users to query the version at runtime.

Location

src/client/client_cli.c (around line 83, where --help is handled)
src/server/server.c (around line 149, where --help is handled)

Suggested Fix

Add a --version flag handler in both binaries that prints the version string from PROTOCOL_VERSION and exits successfully:

if (strcmp(argv[i], "--version") == 0) {
    printf("FastSync version %s\n", PROTOCOL_VERSION);
    return 0;
}

Consider defining a separate FASTSYNC_VERSION macro for the application version distinct from the protocol version.

Severity

Low

Category

Enhancement

## Description Neither the client (`src/client/client_cli.c`) nor the server (`src/server/server.c`) supports a `--version` flag. The `PROTOCOL_VERSION` macro exists in `src/shared/config.h` as `1.2.0`, but there is no way for users to query the version at runtime. ## Location `src/client/client_cli.c` (around line 83, where `--help` is handled) `src/server/server.c` (around line 149, where `--help` is handled) ## Suggested Fix Add a `--version` flag handler in both binaries that prints the version string from `PROTOCOL_VERSION` and exits successfully: ```c if (strcmp(argv[i], "--version") == 0) { printf("FastSync version %s\n", PROTOCOL_VERSION); return 0; } ``` Consider defining a separate `FASTSYNC_VERSION` macro for the application version distinct from the protocol version. ## Severity Low ## Category Enhancement
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#52