From c77e7ae5c3caf5dd99a7d0eca4284407c1993767 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 6 Feb 2023 20:05:30 +0100 Subject: [PATCH 1/2] show help when running "zokrates mpc" --- changelogs/unreleased/1275-dark64 | 1 + zokrates_cli/src/ops/mpc/mod.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/1275-dark64 diff --git a/changelogs/unreleased/1275-dark64 b/changelogs/unreleased/1275-dark64 new file mode 100644 index 000000000..506dce652 --- /dev/null +++ b/changelogs/unreleased/1275-dark64 @@ -0,0 +1 @@ +Show help when running `zokrates mpc` \ No newline at end of file diff --git a/zokrates_cli/src/ops/mpc/mod.rs b/zokrates_cli/src/ops/mpc/mod.rs index 000d82023..dd5913ed1 100644 --- a/zokrates_cli/src/ops/mpc/mod.rs +++ b/zokrates_cli/src/ops/mpc/mod.rs @@ -1,4 +1,4 @@ -use clap::{App, ArgMatches, SubCommand}; +use clap::{App, ArgMatches, SubCommand, AppSettings}; pub mod beacon; pub mod contribute; @@ -9,6 +9,7 @@ pub mod verify; pub fn subcommand() -> App<'static, 'static> { SubCommand::with_name("mpc") .about("Multi-party computation (MPC) protocol") + .setting(AppSettings::SubcommandRequiredElseHelp) .subcommands(vec![ init::subcommand().display_order(1), contribute::subcommand().display_order(2), @@ -25,6 +26,6 @@ pub fn exec(sub_matches: &ArgMatches) -> Result<(), String> { ("beacon", Some(sub_matches)) => beacon::exec(sub_matches), ("verify", Some(sub_matches)) => verify::exec(sub_matches), ("export", Some(sub_matches)) => export::exec(sub_matches), - _ => unreachable!(), + _ => unreachable!() } } From aca048eda55ec5a8637f09bff3305c75f397a126 Mon Sep 17 00:00:00 2001 From: dark64 Date: Mon, 6 Feb 2023 20:07:58 +0100 Subject: [PATCH 2/2] fmt --- zokrates_cli/src/ops/mpc/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zokrates_cli/src/ops/mpc/mod.rs b/zokrates_cli/src/ops/mpc/mod.rs index dd5913ed1..b01a1ddc9 100644 --- a/zokrates_cli/src/ops/mpc/mod.rs +++ b/zokrates_cli/src/ops/mpc/mod.rs @@ -1,4 +1,4 @@ -use clap::{App, ArgMatches, SubCommand, AppSettings}; +use clap::{App, AppSettings, ArgMatches, SubCommand}; pub mod beacon; pub mod contribute; @@ -26,6 +26,6 @@ pub fn exec(sub_matches: &ArgMatches) -> Result<(), String> { ("beacon", Some(sub_matches)) => beacon::exec(sub_matches), ("verify", Some(sub_matches)) => verify::exec(sub_matches), ("export", Some(sub_matches)) => export::exec(sub_matches), - _ => unreachable!() + _ => unreachable!(), } }