use crate::BoxError;
use clientele::{StandardOptions, crates::clap::Subcommand};
#[derive(Debug, Subcommand)]
pub enum ProxyCommand {
#[clap(aliases = ["run"])]
Serve {
#[clap(flatten)]
args: ProxyServeArgs,
},
#[clap(aliases = ["link"])]
Url {},
Host {},
Port {},
#[cfg(feature = "unstable")]
Models {
#[clap(short, long)]
format: Option<String>,
},
Config {
app: ProxyConfigTarget,
#[clap(short, long)]
format: Option<String>,
},
Install {
apps: Vec<ProxyInstallTarget>,
},
}
impl ProxyCommand {
pub async fn run(self, flags: &StandardOptions) -> Result<(), BoxError> {
use ProxyCommand::*;
match self {
Serve { args } => serve(args, flags).await,
Url {} => url(flags).await,
Host {} => host(flags).await,
Port {} => port(flags).await,
#[cfg(feature = "unstable")]
Models { format } => models(format, flags).await,
Config { app, format } => config(app, format, flags).await,
Install { apps } => install(apps, flags).await,
}
}
}
mod config;
pub use config::*;
mod host;
pub use host::*;
mod install;
pub use install::*;
#[cfg(feature = "unstable")]
mod models;
#[cfg(feature = "unstable")]
pub use models::*;
mod port;
pub use port::*;
mod serve;
pub use serve::*;
mod url;
pub use url::*;