Files
YANPM/apps/cli/src/main.rs
GW_MC 829c4ef3e3 Add CLI application with database migration and entity generation commands
- 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.
2025-11-13 21:26:31 +08:00

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;
}