feat: finish django cli and add aliases
Implemented basic wanted functionality for django subcommands. Added single or two letter aliases for all subsubcommands.
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -5,11 +5,15 @@ mod scripts;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use std::env;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// always load dotenv on start
|
||||
dotenvy::dotenv().ok();
|
||||
|
||||
// TODO: (matej) some prints about project
|
||||
// eg: DJANGO_SETTINGS_MODULE for django projects, used docker-compose, etc.
|
||||
|
||||
let args = cli::Ahab::parse();
|
||||
|
||||
match args.command {
|
||||
@@ -26,12 +30,10 @@ fn main() -> Result<()> {
|
||||
cli::DockerCompose::Up => scripts::docker_compose::up(),
|
||||
},
|
||||
cli::Commands::Dj { command } => match command {
|
||||
cli::Django::MakeCommand { app, command } => {
|
||||
scripts::django::make_command(&app, &command)
|
||||
}
|
||||
cli::Django::MakeCommand { app, name } => scripts::django::make_command(&app, &name),
|
||||
cli::Django::Makemigrations => scripts::django::makemigrations(),
|
||||
cli::Django::Manage { rest } => scripts::django::manage(&rest),
|
||||
cli::Django::Migrate => scripts::django::migrate(),
|
||||
cli::Django::Migrate { rest } => scripts::django::migrate(&rest),
|
||||
cli::Django::Shell => scripts::django::shell(),
|
||||
},
|
||||
cli::Commands::Pg { command } => match command {
|
||||
|
||||
Reference in New Issue
Block a user