Skip to content

Commit eb7e2f8

Browse files
authored
Add --version flag to CLI (#189)
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.
1 parent bc9e3fd commit eb7e2f8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ Commands:
5252
help Print this message or the help of the given subcommand(s)
5353
5454
Options:
55-
-h, --help Print help
55+
-h, --help Print help
56+
-V, --version Print version
5657
```
5758

5859
### Using the stdio protocol

src/cli.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use std::path::PathBuf;
2424

2525
/// Elastic MCP server
2626
#[derive(Debug, Parser)]
27+
#[command(version)]
2728
pub struct Cli {
2829
/// Container mode: change default http address, rewrite localhost to the host's address
2930
#[clap(global=true, long, env = "CONTAINER_MODE")]

0 commit comments

Comments
 (0)