mirror of
https://github.com/Start9Labs/rpc-toolkit.git
synced 2026-03-26 02:11:56 +00:00
give matches on display
This commit is contained in:
@@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user