35 lines
1.4 KiB
Rust
35 lines
1.4 KiB
Rust
use ahab::{cli, scripts};
|
|
|
|
use anyhow::Result;
|
|
use clap::Parser;
|
|
|
|
fn main() -> Result<()> {
|
|
let args = cli::Ahab::parse();
|
|
|
|
match args.command {
|
|
cli::Commands::Django { command } => match command {
|
|
cli::Django::Bash => scripts::django::bash(),
|
|
cli::Django::Run { rest } => scripts::django::run(&rest),
|
|
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 { rest } => scripts::django::migrate(&rest),
|
|
cli::Django::Shell => scripts::django::shell(),
|
|
cli::Django::Test => scripts::django::test(),
|
|
},
|
|
cli::Commands::Postgres { command } => match command {
|
|
cli::Postgres::Import { path } => scripts::postgres::import(&path),
|
|
cli::Postgres::Dump { path } => scripts::postgres::dump(&path),
|
|
},
|
|
cli::Commands::Link { command } => match command {
|
|
cli::Link::Add { paths, force } => scripts::link::add(&paths, force),
|
|
cli::Link::Check {
|
|
paths,
|
|
porcelain,
|
|
null,
|
|
} => scripts::link::check(&paths, porcelain, null),
|
|
},
|
|
cli::Commands::Completions { shell } => scripts::completions::completions(shell),
|
|
}
|
|
}
|