@@ -27,6 +27,8 @@ struct ResetProp {
2727 context : bool ,
2828 #[ argh( switch, short = 'n' , long = none) ]
2929 skip_svc : bool ,
30+ #[ argh( switch, short = 'c' , long = "compact" ) ]
31+ compact : bool ,
3032 #[ argh( option, short = 'f' ) ]
3133 file : Option < Utf8CString > ,
3234 #[ argh( option, short = 'd' , long = "delete" ) ]
@@ -59,6 +61,7 @@ General flags:
5961 -h,--help show this message
6062 -v,--verbose print verbose output to stderr
6163 -w switch to wait mode
64+ -c,--compact compact property area
6265
6366Read mode flags:
6467 -p also read persistent properties from storage
@@ -177,6 +180,11 @@ impl ResetProp {
177180 ret
178181 }
179182
183+ fn compact ( & self ) -> bool {
184+ debug ! ( "resetprop: compact property area" ) ;
185+ SYS_PROP . compact ( )
186+ }
187+
180188 fn wait ( & self ) {
181189 let key = & self . args [ 0 ] ;
182190 let val = self . args . get ( 1 ) . map ( |s| & * * s) ;
@@ -227,7 +235,11 @@ impl ResetProp {
227235 }
228236
229237 fn run ( self ) -> LoggedResult < ( ) > {
230- if self . wait_mode {
238+ if self . compact {
239+ if !self . compact ( ) {
240+ return log_err ! ( ) ;
241+ }
242+ } else if self . wait_mode {
231243 self . wait ( ) ;
232244 } else if let Some ( file) = & self . file {
233245 self . load_file ( file) ?;
@@ -269,6 +281,9 @@ pub fn resetprop_main(argc: i32, argv: *mut *mut c_char) -> i32 {
269281 }
270282 special_mode += 1 ;
271283 }
284+ if cli. compact {
285+ special_mode += 1 ;
286+ }
272287 if cli. file . is_some ( ) {
273288 special_mode += 1 ;
274289 }
0 commit comments