clap-utils: Allow nonce/offline args to be global
This commit is contained in:
committed by
Trent Nelson
parent
36d55c0667
commit
972619edb4
@ -36,12 +36,15 @@ pub fn nonce_authority_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||
}
|
||||
|
||||
pub trait NonceArgs {
|
||||
fn nonce_args(self) -> Self;
|
||||
fn nonce_args(self, global: bool) -> Self;
|
||||
}
|
||||
|
||||
impl NonceArgs for App<'_, '_> {
|
||||
fn nonce_args(self) -> Self {
|
||||
self.arg(nonce_arg())
|
||||
.arg(nonce_authority_arg().requires(NONCE_ARG.name))
|
||||
fn nonce_args(self, global: bool) -> Self {
|
||||
self.arg(nonce_arg().global(global)).arg(
|
||||
nonce_authority_arg()
|
||||
.requires(NONCE_ARG.name)
|
||||
.global(global),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -48,13 +48,13 @@ fn signer_arg<'a, 'b>() -> Arg<'a, 'b> {
|
||||
}
|
||||
|
||||
pub trait OfflineArgs {
|
||||
fn offline_args(self) -> Self;
|
||||
fn offline_args(self, global: bool) -> Self;
|
||||
}
|
||||
|
||||
impl OfflineArgs for App<'_, '_> {
|
||||
fn offline_args(self) -> Self {
|
||||
self.arg(blockhash_arg())
|
||||
.arg(sign_only_arg())
|
||||
.arg(signer_arg())
|
||||
fn offline_args(self, global: bool) -> Self {
|
||||
self.arg(blockhash_arg().global(global))
|
||||
.arg(sign_only_arg().global(global))
|
||||
.arg(signer_arg().global(global))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user