refactor: name the modules after what they hold
This commit is contained in:
32
src/main.rs
32
src/main.rs
@@ -2,11 +2,11 @@ use std::process::ExitCode;
|
||||
|
||||
mod cli;
|
||||
mod cmd;
|
||||
mod compose;
|
||||
mod commands;
|
||||
mod ctx;
|
||||
mod fsops;
|
||||
mod output;
|
||||
mod scripts;
|
||||
mod project;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
@@ -43,25 +43,25 @@ fn run(ctx: &Ctx, command: cli::Commands) -> Result<ExitCode> {
|
||||
match command {
|
||||
cli::Commands::Django { command } => {
|
||||
match command {
|
||||
cli::Django::Bash => scripts::django::bash(ctx),
|
||||
cli::Django::Run { rest } => scripts::django::run(ctx, &rest),
|
||||
cli::Django::Bash => commands::django::bash(ctx),
|
||||
cli::Django::Run { rest } => commands::django::run(ctx, &rest),
|
||||
cli::Django::MakeCommand { app, name } => {
|
||||
scripts::django::make_command(ctx, &app, &name)
|
||||
commands::django::make_command(ctx, &app, &name)
|
||||
}
|
||||
cli::Django::Makemigrations => scripts::django::makemigrations(ctx),
|
||||
cli::Django::Manage { rest } => scripts::django::manage(ctx, &rest),
|
||||
cli::Django::Migrate { rest } => scripts::django::migrate(ctx, &rest),
|
||||
cli::Django::Shell => scripts::django::shell(ctx),
|
||||
cli::Django::Test => scripts::django::test(ctx),
|
||||
cli::Django::Makemigrations => commands::django::makemigrations(ctx),
|
||||
cli::Django::Manage { rest } => commands::django::manage(ctx, &rest),
|
||||
cli::Django::Migrate { rest } => commands::django::migrate(ctx, &rest),
|
||||
cli::Django::Shell => commands::django::shell(ctx),
|
||||
cli::Django::Test => commands::django::test(ctx),
|
||||
}?;
|
||||
|
||||
Ok(done)
|
||||
}
|
||||
cli::Commands::Postgres { command } => {
|
||||
match command {
|
||||
cli::Postgres::Import { path } => scripts::postgres::import(ctx, &path),
|
||||
cli::Postgres::Import { path } => commands::postgres::import(ctx, &path),
|
||||
cli::Postgres::Dump { path, format, gzip } => {
|
||||
scripts::postgres::dump(ctx, &path, format, gzip)
|
||||
commands::postgres::dump(ctx, &path, format, gzip)
|
||||
}
|
||||
}?;
|
||||
|
||||
@@ -72,9 +72,9 @@ fn run(ctx: &Ctx, command: cli::Commands) -> Result<ExitCode> {
|
||||
paths,
|
||||
force,
|
||||
store,
|
||||
} => scripts::link::add(ctx, &paths, force, store.root.as_deref()).map(|()| done),
|
||||
} => commands::link::add(ctx, &paths, force, store.root.as_deref()).map(|()| done),
|
||||
cli::Link::Restore { paths, all, store } => {
|
||||
scripts::link::restore(ctx, &paths, all, store.root.as_deref()).map(|()| done)
|
||||
commands::link::restore(ctx, &paths, all, store.root.as_deref()).map(|()| done)
|
||||
}
|
||||
// the one command with something to say through its exit code
|
||||
cli::Link::Check {
|
||||
@@ -83,7 +83,7 @@ fn run(ctx: &Ctx, command: cli::Commands) -> Result<ExitCode> {
|
||||
null,
|
||||
exit_code,
|
||||
store,
|
||||
} => scripts::link::check(
|
||||
} => commands::link::check(
|
||||
ctx,
|
||||
&paths,
|
||||
porcelain,
|
||||
@@ -93,7 +93,7 @@ fn run(ctx: &Ctx, command: cli::Commands) -> Result<ExitCode> {
|
||||
),
|
||||
},
|
||||
cli::Commands::Completions { shell } => {
|
||||
scripts::completions::completions(shell)?;
|
||||
commands::completions::completions(shell)?;
|
||||
|
||||
Ok(done)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user