pma_cli/
lib.rs

1mod command;
2mod export;
3mod pma_client;
4mod read_zip;
5
6use crate::pma_client::PMAClient;
7use command::Command;
8use export::{export, export_all};
9use pma_client::PMAConfig;
10
11pub use command::Opt;
12
13pub async fn run(opt: Opt) -> anyhow::Result<()> {
14    let client = PMAClient::new(PMAConfig {
15        url: opt.url,
16        lang: opt.lang,
17    });
18    match opt.command {
19        Command::Export {
20            tables,
21            export_option,
22        } => export(client, tables, export_option).await?,
23
24        Command::ExportAll {
25            filter_table,
26            export_option,
27        } => export_all(client, filter_table, export_option).await?,
28    }
29    Ok(())
30}