@@ -84,7 +84,7 @@ enum Commands {
8484 } ,
8585 /// Flash an OCI image to fastboot partitions via USB
8686 Fastboot {
87- /// OCI image reference to download and flash (e.g., "registry.example.com/my-image:latest ")
87+ /// OCI image reference to download and flash (must be prefixed with "oci:// ")
8888 image_ref : String ,
8989 /// Device serial number (optional, will use first device if not specified)
9090 #[ arg( short = 's' , long) ]
@@ -301,8 +301,20 @@ async fn main() {
301301 username,
302302 password,
303303 } => {
304+ let image_ref_input = image_ref;
305+ let image_ref = match image_ref_input. strip_prefix ( "oci://" ) {
306+ Some ( reference) => reference,
307+ None => {
308+ eprintln ! (
309+ "Error: fastboot expects an OCI image reference prefixed with 'oci://'"
310+ ) ;
311+ eprintln ! ( " Example: fls fastboot oci://quay.io/org/image:latest" ) ;
312+ std:: process:: exit ( 1 ) ;
313+ }
314+ } ;
315+
304316 println ! ( "Fastboot flash command:" ) ;
305- println ! ( " Image: {}" , image_ref ) ;
317+ println ! ( " Image: {}" , image_ref_input ) ;
306318 if let Some ( ref serial) = serial {
307319 println ! ( " Device serial: {}" , serial) ;
308320 }
@@ -347,7 +359,7 @@ async fn main() {
347359 password,
348360 } ;
349361
350- match fls:: flash_from_fastboot ( & image_ref, options) . await {
362+ match fls:: flash_from_fastboot ( image_ref, options) . await {
351363 Ok ( _) => {
352364 println ! ( "Result: FLASH_COMPLETED" ) ;
353365 std:: process:: exit ( 0 ) ;
0 commit comments