File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Added
11
11
12
12
### Fixed
13
+ - Fixed ` partition-table-offset ` argument to accept offsets in hexadecimal (#682 )
13
14
14
15
### Changed
15
16
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ pub struct ImageArgs {
236
236
#[ arg( long, short = 'T' , value_name = "FILE" ) ]
237
237
pub partition_table : Option < PathBuf > ,
238
238
/// Partition table offset
239
- #[ arg( long, value_name = "OFFSET" ) ]
239
+ #[ arg( long, value_name = "OFFSET" , value_parser = parse_uint32 ) ]
240
240
pub partition_table_offset : Option < u32 > ,
241
241
/// Label of target app partition
242
242
#[ arg( long, value_name = "LABEL" ) ]
@@ -843,3 +843,22 @@ pub fn make_flash_data(
843
843
image_args. min_chip_rev ,
844
844
)
845
845
}
846
+
847
+ mod test {
848
+ use crate :: cli:: FlashArgs ;
849
+ use clap:: Parser ;
850
+
851
+ #[ derive( Parser ) ]
852
+ struct TestParser {
853
+ #[ clap( flatten) ]
854
+ args : FlashArgs ,
855
+ }
856
+
857
+ #[ test]
858
+ fn test_parse_hex_partition_table_offset ( ) {
859
+ let command = "command --partition-table-offset 0x8000" ;
860
+ let iter = command. split_whitespace ( ) ;
861
+ let parser = TestParser :: parse_from ( iter) ;
862
+ assert_eq ! ( parser. args. image. partition_table_offset, Some ( 0x8000 ) ) ;
863
+ }
864
+ }
You can’t perform that action at this time.
0 commit comments