diff --git a/Cargo.lock b/Cargo.lock index 096639111..2872bace1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3471,6 +3471,7 @@ dependencies = [ "bytemuck", "byteorder", "chrono", + "clap", "dasp", "downcast-rs", "encoding_rs", diff --git a/core/Cargo.toml b/core/Cargo.toml index f8f4aba7d..8a305d88c 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -48,6 +48,7 @@ enumset = "1.0.12" static_assertions = "1.1.0" rustversion = "1.0.11" bytemuck = "1.13.0" +clap = { version = "4.1.4", features = ["derive"], optional=true } [target.'cfg(not(target_family = "wasm"))'.dependencies.futures] version = "0.3.26" diff --git a/core/src/loader.rs b/core/src/loader.rs index 0a328f364..19ab8ef1a 100644 --- a/core/src/loader.rs +++ b/core/src/loader.rs @@ -40,6 +40,7 @@ use url::form_urlencoded; pub type Handle = Index; /// How Ruffle should load movies. +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[derive(Debug, Clone, Copy)] pub enum LoadBehavior { /// Allow movies to execute before they have finished loading. diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index 0da05bbce..3d5d37e42 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -10,7 +10,7 @@ version.workspace = true [dependencies] clap = { version = "4.1.4", features = ["derive"] } cpal = "0.15.0" -ruffle_core = { path = "../core", features = ["audio", "mp3", "nellymoser"] } +ruffle_core = { path = "../core", features = ["audio", "clap", "mp3", "nellymoser"] } ruffle_render = { path = "../render" } ruffle_render_wgpu = { path = "../render/wgpu", features = ["clap"] } ruffle_video_software = { path = "../video/software", optional = true } diff --git a/desktop/src/main.rs b/desktop/src/main.rs index d0e4fb6db..227016ddc 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -63,7 +63,7 @@ static RUFFLE_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/version-in version = RUFFLE_VERSION, )] struct Opt { - /// Path to a Flash movie (SWF) to play. + /// Path or URL of a Flash movie (SWF) to play. #[clap(name = "FILE")] input_path: Option,