stellar_registry_cli/commands/
version.rs

1use clap::Parser;
2use std::fmt::Debug;
3
4#[derive(Parser, Debug, Clone)]
5#[group(skip)]
6pub struct Cmd;
7
8impl Cmd {
9    #[allow(clippy::unused_self)]
10    pub fn run(&self) {
11        println!("stellar registry {}", long());
12    }
13}
14
15pub fn pkg() -> &'static str {
16    env!("CARGO_PKG_VERSION")
17}
18
19pub fn git() -> &'static str {
20    env!("GIT_REVISION")
21}
22
23pub fn long() -> String {
24    [
25        format!("{} ({})", pkg(), git()),
26        format!(
27            "stellar {} ({})",
28            stellar_cli::commands::version::pkg(),
29            stellar_cli::commands::version::git()
30        ),
31    ]
32    .join("\n")
33}