split generated code so that methods are now in core

This commit is contained in:
nora 2022-02-20 21:22:30 +01:00
parent 3b656b911a
commit c333f20531
20 changed files with 1337 additions and 1206 deletions

View file

@ -1,22 +1,24 @@
mod codegen;
fn main() {
fn main() -> anyhow::Result<()> {
let command = std::env::args().nth(1).unwrap_or_else(|| {
eprintln!("No task provided");
eprintln!("Error: No task provided");
help();
std::process::exit(1);
});
match command.as_str() {
"generate" | "gen" => codegen::main(),
_ => eprintln!("Unknown command {command}."),
_ => {
eprintln!("Unknown command {command}.");
Ok(())
}
}
}
fn help() {
println!(
"Available tasks:
generate - Generate amqp method code in `amqp_transport/src/methods/generated.rs.
Dumps code to stdout and should be redirected manually."
generate, gen - Generate amqp method code in `amqp_transport/src/methods/generated.rs and amqp_core/src/methods/generated.rs"
);
}