- Introduced a new CLI application in the `apps/cli` directory. - Implemented commands for database migration and entity generation. - Updated `Cargo.toml` files to include necessary dependencies. - Enhanced the `justfile` to facilitate CLI command execution. - Modified workspace configuration to include the new CLI application.
23 lines
649 B
Rust
23 lines
649 B
Rust
mod cmd;
|
|
|
|
use clap::error::ErrorKind;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let mut command = cmd::get_command();
|
|
let help_output = format!("{}", command.render_help());
|
|
let matches = command
|
|
.try_get_matches()
|
|
.unwrap_or_else(|err| match err.kind() {
|
|
ErrorKind::DisplayHelp | ErrorKind::DisplayVersion => {
|
|
err.print().expect("Error writing Error");
|
|
std::process::exit(0);
|
|
}
|
|
_ => {
|
|
err.print().expect("Error writing Error");
|
|
std::process::exit(1);
|
|
}
|
|
});
|
|
cmd::execute(&matches, &help_output).await;
|
|
}
|