give matches on display

This commit is contained in:
Aiden McClelland
2021-05-21 11:43:48 -06:00
parent f3cd9f5e86
commit f5217d0e53
2 changed files with 6 additions and 6 deletions

View File

@@ -618,7 +618,7 @@ fn cli_handler(
}; };
let res = rt_ref.block_on(rpc_toolkit_prelude::call_remote(ctx, method.as_ref(), params, return_ty))?; let res = rt_ref.block_on(rpc_toolkit_prelude::call_remote(ctx, method.as_ref(), params, return_ty))?;
Ok(#display(res.result?)) Ok(#display(res.result?, matches))
} }
} }
} }
@@ -634,11 +634,11 @@ fn cli_handler(
}; };
let display_res = if let Some(display_fn) = &opt.display { let display_res = if let Some(display_fn) = &opt.display {
quote! { quote! {
#display_fn(#invocation) #display_fn(#invocation, matches)
} }
} else { } else {
quote! { quote! {
rpc_toolkit_prelude::default_display(#invocation) rpc_toolkit_prelude::default_display(#invocation, matches)
} }
}; };
let rt_action = if opt.is_async { let rt_action = if opt.is_async {
@@ -726,7 +726,7 @@ fn cli_handler(
} }
}; };
quote! { quote! {
Ok(#display(#self_impl)), Ok(#display(#self_impl, matches)),
} }
} }
(Some(self_impl), ExecutionContext::Standard) => { (Some(self_impl), ExecutionContext::Standard) => {
@@ -760,7 +760,7 @@ fn cli_handler(
}; };
let res = rt_ref.block_on(rpc_toolkit_prelude::call_remote(ctx, method.as_ref(), params, return_ty))?; let res = rt_ref.block_on(rpc_toolkit_prelude::call_remote(ctx, method.as_ref(), params, return_ty))?;
Ok(#display(res.result?)) Ok(#display(res.result?, matches))
} }
} }
} }

View File

@@ -123,6 +123,6 @@ pub fn default_stdin_parser<T: FromStr<Err = E>, E: Display>(
}) })
} }
pub fn default_display<T: Display>(t: T) { pub fn default_display<T: Display>(t: T, _: &ArgMatches<'_>) {
println!("{}", t) println!("{}", t)
} }