Skip to content

Commit 9355d03

Browse files
authored
Merge pull request #553 from input-output-hk/greg/541/version_api
Add version information
2 parents 443a576 + 6056fb7 commit 9355d03

File tree

8 files changed

+234
-125
lines changed

8 files changed

+234
-125
lines changed

Cargo.lock

Lines changed: 216 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/protocol-demo/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ base64 = "0.13.0"
99
clap = { version = "3.1.6", features = ["derive"] }
1010
hex = "0.4.3"
1111
log = "0.4.14"
12-
mithril-common = { path = "../../mithril-common", features = ["allow_skip_signer_certification"]}
12+
mithril-common = { path = "../../mithril-common", features = ["allow_skip_signer_certification"] }
1313
rand_chacha = "0.3.1"
1414
rand_core = "0.6.3"
1515
serde = { version = "1.0", features = ["derive"] }

mithril-aggregator/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "A Mithril Aggregator server"
88
[dependencies]
99
async-trait = "0.1.52"
1010
chrono = "0.4"
11-
clap = { version = "3.1.6", features = ["derive", "env"] }
11+
clap = { version = "4.0", features = ["derive", "env", "cargo"] }
1212
cloud-storage = "0.11.0"
1313
config = "0.13.1"
1414
flate2 = "1.0.23"
@@ -30,7 +30,7 @@ warp = "0.3"
3030

3131
[dev-dependencies]
3232
httpmock = "0.6.6"
33-
mithril-common = { path = "../mithril-common", features = ["test_only"]}
33+
mithril-common = { path = "../mithril-common", features = ["test_only"] }
3434
mockall = "0.11.0"
3535
slog-term = "2.9.0"
3636
tempfile = "3.3.0"

mithril-aggregator/src/command_args.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ async fn do_first_launch_initialization_if_needed(
137137

138138
/// Mithril Aggregator Node
139139
#[derive(Parser, Debug, Clone)]
140+
#[command(version)]
140141
pub struct MainOpts {
141142
/// application main command
142143
#[clap(subcommand)]
@@ -147,8 +148,8 @@ pub struct MainOpts {
147148
pub run_mode: String,
148149

149150
/// Verbosity level
150-
#[clap(short, long, parse(from_occurrences))]
151-
pub verbose: usize,
151+
#[clap(short, long, action = clap::ArgAction::Count)]
152+
pub verbose: u8,
152153

153154
/// Directory of the Cardano node files
154155
#[clap(long)]

mithril-client/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description = "A Mithril Client"
77

88
[dependencies]
99
async-trait = "0.1.52"
10-
clap = { version = "3.1.6", features = ["derive", "env"] }
10+
clap = { version = "4.0", features = ["derive", "env"] }
1111
cli-table = "0.4"
1212
config = "0.13.1"
1313
flate2 = "1.0.23"
@@ -27,7 +27,7 @@ tokio = { version = "1", features = ["full"] }
2727

2828
[dev-dependencies]
2929
httpmock = "0.6.6"
30-
mithril-common = { path = "../mithril-common", features = ["test_only"]}
30+
mithril-common = { path = "../mithril-common", features = ["test_only"] }
3131
mockall = "0.11.0"
3232

3333
[features]

mithril-client/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use mithril_client::commands::{DownloadCommand, ListCommand, RestoreCommand, Sho
1818
about = "This program downloads, checks and restores certified blockchain snapshots.",
1919
long_about = None
2020
)]
21+
#[command(version)]
2122
pub struct Args {
2223
/// Available commands
2324
#[clap(subcommand)]
@@ -28,8 +29,8 @@ pub struct Args {
2829
run_mode: String,
2930

3031
/// Verbosity level (-v=warning, -vv=info, -vvv=debug).
31-
#[clap(short, long, parse(from_occurrences))]
32-
verbose: usize,
32+
#[clap(short, long, action = clap::ArgAction::Count)]
33+
verbose: u8,
3334

3435
/// Directory where configuration file is located.
3536
#[clap(long, default_value = "./config")]

mithril-signer/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description = "A Mithril Signer"
77

88
[dependencies]
99
async-trait = "0.1.52"
10-
clap = { version = "3.1.6", features = ["derive", "env"] }
10+
clap = { version = "4.0", features = ["derive", "env"] }
1111
config = "0.13.1"
1212
hex = "0.4.3"
1313
mithril-common = { path = "../mithril-common" }
@@ -25,7 +25,7 @@ tokio = { version = "1.17.0", features = ["full"] }
2525

2626
[dev-dependencies]
2727
httpmock = "0.6.6"
28-
mithril-common = { path = "../mithril-common", features = ["test_only"]}
28+
mithril-common = { path = "../mithril-common", features = ["test_only"] }
2929
mockall = "0.11.0"
3030
slog-term = "2.9.0"
3131

mithril-signer/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use mithril_signer::{
1313
#[derive(Parser)]
1414
#[clap(name = "mithril-signer")]
1515
#[clap(about = "An implementation of a Mithril Signer", long_about = None)]
16+
#[command(version)]
1617
pub struct Args {
1718
/// Run Mode
1819
#[clap(short, long, env("RUN_MODE"), default_value = "dev")]
@@ -22,17 +23,17 @@ pub struct Args {
2223
#[clap(
2324
short,
2425
long,
25-
parse(from_occurrences),
26-
help = "verbosity level, add more v to increase"
26+
action = clap::ArgAction::Count,
27+
help = "Verbosity level, add more v to increase"
2728
)]
28-
verbose: usize,
29+
verbose: u8,
2930

3031
/// Configuration file location
3132
#[clap(
3233
short,
3334
long,
3435
default_value = "./config",
35-
help = "directory where the configuration file is located"
36+
help = "Directory where the configuration file is located"
3637
)]
3738
configuration_dir: PathBuf,
3839
}

0 commit comments

Comments
 (0)