From 168a508773cd478d1c3671bc6c4cc1edada5d8b7 Mon Sep 17 00:00:00 2001 From: Preston Evans <32944016+preston-evans98@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:42:50 -0700 Subject: [PATCH] Improve generated cli help (#581) --- .../module-implementations/sov-accounts/src/call.rs | 7 ++++++- module-system/sov-modules-macros/src/cli_parser.rs | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/module-system/module-implementations/sov-accounts/src/call.rs b/module-system/module-implementations/sov-accounts/src/call.rs index b9027e5fe..15d9bf104 100644 --- a/module-system/module-implementations/sov-accounts/src/call.rs +++ b/module-system/module-implementations/sov-accounts/src/call.rs @@ -23,7 +23,12 @@ pub const UPDATE_ACCOUNT_MSG: [u8; 32] = [1; 32]; pub enum CallMessage { /// Updates a public key for the corresponding Account. /// The sender must be in possession of the new key. - UpdatePublicKey(C::PublicKey, C::Signature), + UpdatePublicKey( + /// The new public key + C::PublicKey, + /// A valid signature from the new public key + C::Signature, + ), } impl Accounts { diff --git a/module-system/sov-modules-macros/src/cli_parser.rs b/module-system/sov-modules-macros/src/cli_parser.rs index dead195b2..b1cfaa477 100644 --- a/module-system/sov-modules-macros/src/cli_parser.rs +++ b/module-system/sov-modules-macros/src/cli_parser.rs @@ -206,6 +206,7 @@ pub(crate) fn derive_cli_wallet_arg( Fields::Unnamed(_) => { variants_with_named_fields.push(quote! { #( #variant_docs )* + #[command(arg_required_else_help(true))] #variant_name {#(#named_variant_fields),* } }); convert_cases.push(quote! { @@ -215,6 +216,7 @@ pub(crate) fn derive_cli_wallet_arg( Fields::Named(_) => { variants_with_named_fields.push(quote! { #( #variant_docs )* + #[command(arg_required_else_help(true))] #variant_name {#(#named_variant_fields),* } }); convert_cases.push(quote! {