diff --git a/example.nomen.toml b/example.nomen.toml index b6799ad..057bc00 100644 --- a/example.nomen.toml +++ b/example.nomen.toml @@ -24,4 +24,3 @@ password = "rpc password" host = "localhost" port = 8441 network = "bitcoin" - diff --git a/nomen/src/config/cli.rs b/nomen/src/config/cli.rs index 4e69e53..9267e10 100644 --- a/nomen/src/config/cli.rs +++ b/nomen/src/config/cli.rs @@ -28,4 +28,7 @@ pub enum Subcommand { /// Rescan the blockchain, given an optional starting blockheight. This operation is slow, it redownloads blocks. Rescan { blockheight: Option }, + + /// Prints the current version of application + Version, } diff --git a/nomen/src/main.rs b/nomen/src/main.rs index c237ff0..3756b34 100644 --- a/nomen/src/main.rs +++ b/nomen/src/main.rs @@ -34,6 +34,9 @@ async fn main() -> anyhow::Result<()> { config::Subcommand::Rescan { blockheight } => { subcommands::rescan(&config, &pool, blockheight.unwrap_or_default()).await?; } + config::Subcommand::Version => { + subcommands::version(); + } } Ok(()) diff --git a/nomen/src/subcommands/mod.rs b/nomen/src/subcommands/mod.rs index 723ea68..e69b8fa 100644 --- a/nomen/src/subcommands/mod.rs +++ b/nomen/src/subcommands/mod.rs @@ -46,3 +46,8 @@ pub(crate) async fn rescan( Ok(()) } + +pub(crate) fn version() { + let version = env!("CARGO_PKG_VERSION"); + println!("Current version is {version}"); +}