Skip to content

Commit dc446d6

Browse files
committed
fix into command not taking into account features
1 parent 630a0b9 commit dc446d6

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

crates/xtask/src/main.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ impl IntoFeatureGroup for Feature {
107107
#[derive(Debug, Clone, PartialEq, Eq)]
108108
struct Features(HashSet<Feature>);
109109

110+
impl Default for Features {
111+
fn default() -> Self {
112+
Features::new(vec![Feature::Lua54])
113+
}
114+
}
115+
110116
impl Features {
111117
fn new<I: IntoIterator<Item = Feature>>(features: I) -> Self {
112118
Self(features.into_iter().collect())
@@ -207,6 +213,16 @@ impl App {
207213
fn into_command(self) -> Command {
208214
let mut cmd = Command::new("cargo");
209215
cmd.arg("xtask");
216+
217+
if self.global_args.features != Features::default() {
218+
cmd.arg("--features")
219+
.arg(self.global_args.features.to_string());
220+
}
221+
222+
if let Some(profile) = self.global_args.profile {
223+
cmd.arg("--profile").arg(profile);
224+
}
225+
210226
match self.subcmd {
211227
Xtasks::Macros { macro_name } => {
212228
cmd.arg("macros").arg(macro_name.as_ref());
@@ -294,7 +310,7 @@ impl App {
294310

295311
#[derive(Debug, Parser, Clone)]
296312
struct GlobalArgs {
297-
#[clap(long, short, global = true, value_parser=clap::value_parser!(Features), value_name=Features::to_placeholder(), default_value="lua54",required = false)]
313+
#[clap(long, short, global = true, value_parser=clap::value_parser!(Features), value_name=Features::to_placeholder(), default_value=Features::default().to_string(),required = false)]
298314
features: Features,
299315

300316
#[clap(

0 commit comments

Comments
 (0)