Skip to content

Conversation

@SimonKaran13
Copy link
Contributor

Add support for --version (-V) flag to display the current version. The version is now available on-demand via CLI flag in addition to being displayed during server startup.

Updates:

  • Add version attribute to CLI struct using clap's built-in version support
  • Update README.md to document the new --version flag and usage

Resolves the common CLI expectation of having a version flag.

@cla-checker-service
Copy link

cla-checker-service bot commented Aug 11, 2025

💚 CLA has been signed

Copy link
Contributor

@swallez swallez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple addition, but can be made even simpler 😉
Can you update the PR? And then I'll be happy to merge it!

src/cli.rs Outdated

/// Elastic MCP server
#[derive(Debug, Parser)]
#[command(version = env!("CARGO_PKG_VERSION"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[command(version)] uses the Cargo version by default. Can you simplify this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, I updated the PR 😄

Add support for --version (-V) flag to display the current version.
The version is now available on-demand via CLI flag in addition to
being displayed during server startup.

Updates:
- Add version attribute to CLI struct using clap's built-in version support
- Update README.md to document the new --version flag and usage

Resolves the common CLI expectation of having a version flag.
@SimonKaran13 SimonKaran13 force-pushed the feat/add-version-flag branch from e3bcd78 to f158e20 Compare August 12, 2025 17:55
@SimonKaran13 SimonKaran13 requested a review from swallez August 13, 2025 15:18
Copy link
Contributor

@swallez swallez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this contribution!

@swallez swallez merged commit eb7e2f8 into elastic:main Aug 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants