-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
A-RunRelated to the bevy run commandRelated to the bevy run commandA-WebBuilding or running Bevy apps targeting the browserBuilding or running Bevy apps targeting the browserC-BugA bug in the programA bug in the program
Description
Its currently not possible to pass additional arguments to the bevy app when using the web subcommand. This is because:
#[derive(Debug, Args, Clone)]
pub struct RunArgs {
/// The subcommands available for the run command.
#[command(subcommand)]
pub subcommand: Option<RunSubcommands>,
/// Confirm all prompts automatically.
#[arg(long = "yes", default_value_t = false)]
pub confirm_prompts: bool,
/// Commands to forward to `cargo run`.
#[clap(flatten)]
pub cargo_args: CargoRunArgs,
/// Arguments to pass to the underlying Bevy app.
///
/// Specified after `--`.
#[clap(last = true, name = "ARGS")]
pub forward_args: Vec<String>,
}Results in the following: Usage: bevy run [OPTIONS] [-- <ARGS>...] [COMMAND]
But: bevy run -- --foo web will result in cargo run --profile dev -- --mute web.
See also: https://docs.rs/clap/latest/clap/struct.Arg.html#method.last
WARNING: Using this setting and having child subcommands is not recommended with the exception of also using crate::Command::args_conflicts_with_subcommands (or crate::Command::subcommand_negates_reqs if the argument marked Last is also marked Arg::required)
Metadata
Metadata
Assignees
Labels
A-RunRelated to the bevy run commandRelated to the bevy run commandA-WebBuilding or running Bevy apps targeting the browserBuilding or running Bevy apps targeting the browserC-BugA bug in the programA bug in the program