@@ -111,6 +111,10 @@ enum Command {
111111 /// Optional argument specifying build mode.
112112 #[ clap( short = 'm' , long) ]
113113 mode : Option < String > ,
114+
115+ /// Command used to run Buck2. Defaults to `buck2`.
116+ #[ clap( long) ]
117+ buck2_command : Option < String > ,
114118 } ,
115119 /// `DevelopJson` is a more limited, stripped down [`Command::Develop`].
116120 ///
@@ -131,6 +135,10 @@ enum Command {
131135 client : Option < String > ,
132136
133137 args : JsonArguments ,
138+
139+ /// Command used to run Buck2. Defaults to `buck2`.
140+ #[ clap( long) ]
141+ buck2_command : Option < String > ,
134142 } ,
135143 /// Build the saved file's owning target. This is meant to be used by IDEs to provide diagnostics on save.
136144 Check {
@@ -147,6 +155,9 @@ enum Command {
147155
148156 /// The file saved by the user. `rust-project` will infer the owning target(s) of the saved file and build them.
149157 saved_file : PathBuf ,
158+ /// Command used to run Buck2. Defaults to `buck2`.
159+ #[ clap( long) ]
160+ buck2_command : Option < String > ,
150161 } ,
151162}
152163
@@ -287,12 +298,13 @@ fn main() -> Result<(), anyhow::Error> {
287298 mode,
288299 use_clippy,
289300 saved_file,
301+ buck2_command,
290302 ..
291303 } => {
292304 let subscriber = tracing_subscriber:: registry ( ) . with ( fmt. with_filter ( filter) ) ;
293305 tracing:: subscriber:: set_global_default ( subscriber) ?;
294306
295- cli:: Check :: new ( mode, use_clippy, saved_file. clone ( ) )
307+ cli:: Check :: new ( buck2_command , mode, use_clippy, saved_file. clone ( ) )
296308 . run ( )
297309 . inspect_err ( |e| crate :: scuba:: log_check_error ( & e, & saved_file, use_clippy) )
298310 }
@@ -376,6 +388,7 @@ fn json_args_pass() {
376388 args,
377389 sysroot_mode : SysrootMode :: Rustc ,
378390 client : None ,
391+ buck2_command : None ,
379392 } ) ,
380393 version : false ,
381394 } ;
@@ -393,6 +406,7 @@ fn json_args_pass() {
393406 args,
394407 sysroot_mode : SysrootMode :: Rustc ,
395408 client : None ,
409+ buck2_command : None ,
396410 } ) ,
397411 version : false ,
398412 } ;
@@ -410,6 +424,7 @@ fn json_args_pass() {
410424 args,
411425 sysroot_mode : SysrootMode :: Rustc ,
412426 client : None ,
427+ buck2_command : None ,
413428 } ) ,
414429 version : false ,
415430 } ;
0 commit comments