diff --git a/internal/config_specification.toml b/internal/config_specification.toml index 27cba14..91987de 100644 --- a/internal/config_specification.toml +++ b/internal/config_specification.toml @@ -108,6 +108,10 @@ doc = "Exit after the initial sync is over (don't start Electrum server)." name = "cache_merkle_proofs" doc = "Cache merkle proofs on subscription (if disabled, they are computed on demand)." +[[switch]] +name = "version" +doc = "Print out the program version." + [[param]] name = "index_lookup_limit" type = "usize" diff --git a/src/config.rs b/src/config.rs index 3b2d316..78db4af 100644 --- a/src/config.rs +++ b/src/config.rs @@ -308,6 +308,11 @@ impl Config { std::process::exit(1); } + if config.version { + println!("v{}", ELECTRS_VERSION); + std::process::exit(0); + } + let config = Config { network: config.network, db_path: config.db_dir,