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.
This commit is contained in:
22
apps/cli/src/main.rs
Normal file
22
apps/cli/src/main.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user