Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4502,6 +4502,7 @@ Print version information

- `--only-version` — Print only the version
- `--only-version-major` — Print only the major version
- `--only-commit` — Print only the commit sha

## `stellar plugin`

Expand Down
9 changes: 7 additions & 2 deletions cmd/soroban-cli/src/commands/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ use std::fmt::Debug;
#[group(skip)]
pub struct Cmd {
/// Print only the version.
#[arg(long)]
#[arg(long, group = "only")]
only_version: bool,
/// Print only the major version.
#[arg(long)]
#[arg(long, group = "only")]
only_version_major: bool,
/// Print only the commit sha.
#[arg(long, group = "only")]
only_commit: bool,
Comment thread
leighmcculloch marked this conversation as resolved.
}

impl Cmd {
Expand All @@ -19,6 +22,8 @@ impl Cmd {
println!("{}", pkg());
} else if self.only_version_major {
println!("{}", major());
} else if self.only_commit {
println!("{}", git());
Comment thread
leighmcculloch marked this conversation as resolved.
} else {
println!("stellar {}", long());
}
Expand Down
Loading