Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --version command #171

Merged
merged 1 commit into from
Jan 28, 2025
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
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "integration-tests"
description = "Crate containing Zaino's integration-tests."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }
zancas marked this conversation as resolved.
Show resolved Hide resolved

[dependencies]
# Test utility
Expand Down
6 changes: 4 additions & 2 deletions zaino-fetch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "zaino-fetch"
description = "A mempool-fetching, chain-fetching and transaction submission service that uses zebra's RPC interface."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }

[dependencies]
zaino-proto = { path = "../zaino-proto" }
Expand Down
6 changes: 4 additions & 2 deletions zaino-proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "zaino-proto"
description = "Holds tonic files and build logic for the lightwallet and darkside RPCs."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }

[dependencies]
# Miscellaneous Workspace
Expand Down
6 changes: 4 additions & 2 deletions zaino-serve/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "zaino-serve"
description = "Crate containing Zingo's gRPC server implementation."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }

[features]
state_service = []
Expand Down
7 changes: 4 additions & 3 deletions zaino-state/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[package]
name = "zaino-state"
description = "A mempool and chain-fetching service built on top of zebra's ReadStateService and TrustedChainSync."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }

homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }

[dependencies]
zaino-fetch = { path = "../zaino-fetch" }
Expand Down
6 changes: 4 additions & 2 deletions zaino-testutils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "zaino-testutils"
description = "Crate containing Zaino test specific functionality."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }

[features]
# Used by zcash-local-net:
Expand Down
6 changes: 4 additions & 2 deletions zainod/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "zainod"
description = "Crate containing the Zaino Indexer binary."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
version = { workspace = true }

[[bin]]
name = "zainod"
Expand Down
14 changes: 11 additions & 3 deletions zainod/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! Zingo-Indexer daemon

use clap::Parser;
use clap::{CommandFactory, Parser};
use std::path::PathBuf;
use zainodlib::{config::load_config, indexer::Indexer};

#[derive(Parser, Debug)]
#[command(name = "zindexer", about = "A server for Zingo-Indexer")]
#[command(name = "Zaino", about = "The Zcash Indexing Service", version)]
zancas marked this conversation as resolved.
Show resolved Hide resolved
struct Args {
/// Path to the configuration file
#[arg(short, long, value_name = "FILE")]
Expand All @@ -14,8 +14,16 @@ struct Args {

#[tokio::main]
async fn main() {
let args = Args::parse();

if std::env::args().any(|arg| arg == "--version" || arg == "-V") {
zancas marked this conversation as resolved.
Show resolved Hide resolved
let cmd = Args::command();
println!("{}", cmd.get_version().unwrap());
return;
}

Indexer::start(load_config(
&Args::parse()
&args
.config
.unwrap_or_else(|| PathBuf::from("./zainod/zindexer.toml")),
))
Expand Down
Loading