Allowing dumping generated cdef

This commit is contained in:
lumi 2025-06-25 22:48:46 +10:00
parent 014687068f
commit 2967513cbb
Signed by: luaneko
GPG Key ID: 406809B8763FF07A

View File

@ -97,6 +97,15 @@ struct Args {
)]
console_addr: SocketAddr,
/// Dump internal data.
#[clap(
long,
help_heading = "Debugging",
value_name = "DATA",
value_parser = ["cdef"]
)]
dump: Vec<String>,
/// Print version.
#[clap(long, short = 'V')]
version: bool,
@ -198,6 +207,11 @@ fn init_tokio(args: &Args) -> tokio::runtime::Runtime {
fn init_lua(args: &Args) -> lb::runtime::Runtime {
let rt = lb::runtime::Builder::new();
if args.dump.iter().find(|s| *s == "cdef").is_some() {
print!("{}", rt.registry());
}
let mut rt = rt.build().unwrap_or_else(exit_err(ExitCode::Software));
for arg in args.jit.iter() {