@@ -107,6 +107,12 @@ impl IntoFeatureGroup for Feature {
107
107
#[ derive( Debug , Clone , PartialEq , Eq ) ]
108
108
struct Features ( HashSet < Feature > ) ;
109
109
110
+ impl Default for Features {
111
+ fn default ( ) -> Self {
112
+ Features :: new ( vec ! [ Feature :: Lua54 ] )
113
+ }
114
+ }
115
+
110
116
impl Features {
111
117
fn new < I : IntoIterator < Item = Feature > > ( features : I ) -> Self {
112
118
Self ( features. into_iter ( ) . collect ( ) )
@@ -207,6 +213,16 @@ impl App {
207
213
fn into_command ( self ) -> Command {
208
214
let mut cmd = Command :: new ( "cargo" ) ;
209
215
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
+
210
226
match self . subcmd {
211
227
Xtasks :: Macros { macro_name } => {
212
228
cmd. arg ( "macros" ) . arg ( macro_name. as_ref ( ) ) ;
@@ -294,7 +310,7 @@ impl App {
294
310
295
311
#[ derive( Debug , Parser , Clone ) ]
296
312
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 ) ]
298
314
features : Features ,
299
315
300
316
#[ clap(
0 commit comments