mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
misc
This commit is contained in:
parent
1992f7f80a
commit
28ad29ede3
3 changed files with 30 additions and 32 deletions
56
src/args.rs
56
src/args.rs
|
|
@ -8,63 +8,61 @@ use std::str::FromStr;
|
|||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub enum HazeArgs {
|
||||
List {
|
||||
filter: Option<String>,
|
||||
},
|
||||
Start {
|
||||
options: CloudOptions,
|
||||
},
|
||||
Stop {
|
||||
filter: Option<String>,
|
||||
},
|
||||
/// List all instances
|
||||
List { filter: Option<String> },
|
||||
/// Start a new instance
|
||||
Start { options: CloudOptions },
|
||||
/// Stop an instance
|
||||
Stop { filter: Option<String> },
|
||||
/// Run tests in a new instance
|
||||
Test {
|
||||
options: CloudOptions,
|
||||
args: Vec<String>,
|
||||
},
|
||||
/// Run a command in an instance
|
||||
Exec {
|
||||
filter: Option<String>,
|
||||
service: Option<ExecService>,
|
||||
command: Vec<String>,
|
||||
},
|
||||
/// Run an occ command in an instance
|
||||
Occ {
|
||||
filter: Option<String>,
|
||||
command: Vec<String>,
|
||||
},
|
||||
Db {
|
||||
filter: Option<String>,
|
||||
root: bool,
|
||||
},
|
||||
/// Connect to the database of an instance
|
||||
Db { filter: Option<String>, root: bool },
|
||||
/// Remove all non-pinned instances
|
||||
Clean,
|
||||
/// View the logs from an instance or service
|
||||
Logs {
|
||||
filter: Option<String>,
|
||||
follow: bool,
|
||||
service: Option<LogService>,
|
||||
count: Option<usize>,
|
||||
},
|
||||
Open {
|
||||
filter: Option<String>,
|
||||
},
|
||||
Fmt {
|
||||
path: String,
|
||||
},
|
||||
/// Open an instance in the browser
|
||||
Open { filter: Option<String> },
|
||||
/// Run code formatting from a new instance
|
||||
Fmt { path: String },
|
||||
/// Run integration tests in a new instance
|
||||
Integration {
|
||||
options: CloudOptions,
|
||||
args: Vec<String>,
|
||||
},
|
||||
/// Start a shell in an empirical instance
|
||||
Shell {
|
||||
options: CloudOptions,
|
||||
command: Vec<String>,
|
||||
},
|
||||
Pin {
|
||||
filter: Option<String>,
|
||||
},
|
||||
Unpin {
|
||||
filter: Option<String>,
|
||||
},
|
||||
/// Pin an instance
|
||||
Pin { filter: Option<String> },
|
||||
/// Unpin an instance
|
||||
Unpin { filter: Option<String> },
|
||||
/// Start the proxy
|
||||
Proxy,
|
||||
Checkout {
|
||||
branch: String,
|
||||
},
|
||||
/// Checkout a branch in all apps
|
||||
Checkout { branch: String },
|
||||
Env {
|
||||
filter: Option<String>,
|
||||
command: String,
|
||||
|
|
@ -120,7 +118,7 @@ impl HazeArgs {
|
|||
None => {
|
||||
return Ok(HazeArgs::List {
|
||||
filter: Some(command_or_filter.into()),
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
if !cmd.allows_filter() {
|
||||
|
|
|
|||
|
|
@ -350,10 +350,10 @@ async fn main() -> Result<()> {
|
|||
.ok_or_else(|| Report::msg(format!("{} is not running", cloud.id)))?;
|
||||
let db_type = match cloud.db().family() {
|
||||
DatabaseFamily::Sqlite => {
|
||||
return Err(Report::msg("sqlite is not supported with `haze env`"))
|
||||
return Err(Report::msg("sqlite is not supported with `haze env`"));
|
||||
}
|
||||
DatabaseFamily::Oracle => {
|
||||
return Err(Report::msg("oracle is not supported with `haze env`"))
|
||||
return Err(Report::msg("oracle is not supported with `haze env`"));
|
||||
}
|
||||
DatabaseFamily::Mysql | DatabaseFamily::MariaDB => "mysql",
|
||||
DatabaseFamily::Postgres => "postgresql",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use bollard::network::CreateNetworkOptions;
|
||||
use bollard::Docker;
|
||||
use bollard::network::CreateNetworkOptions;
|
||||
use miette::{IntoDiagnostic, Result, WrapErr};
|
||||
|
||||
pub async fn clear_networks(docker: &Docker) -> Result<()> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue