File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ fn main() {
206
206
let mut connection_file: Option < String > = None ;
207
207
let mut log_file: Option < String > = None ;
208
208
let mut startup_notifier_file: Option < String > = None ;
209
+ let mut startup_delay: Option < std:: time:: Duration > = None ;
209
210
let mut has_action = false ;
210
211
let mut capture_streams = true ;
211
212
@@ -254,6 +255,21 @@ fn main() {
254
255
break ;
255
256
}
256
257
} ,
258
+ "--startup-delay" => {
259
+ if let Some ( delay_arg) = argv. next ( ) {
260
+ if let Ok ( delay) = delay_arg. parse :: < u64 > ( ) {
261
+ startup_delay = Some ( std:: time:: Duration :: from_millis ( delay) ) ;
262
+ } else {
263
+ eprintln ! ( "Can't parse delay in milliseconds" ) ;
264
+ break ;
265
+ }
266
+ } else {
267
+ eprintln ! (
268
+ "A delay in milliseconds must be specified with the --startup-delay argument."
269
+ ) ;
270
+ break ;
271
+ }
272
+ } ,
257
273
other => {
258
274
eprintln ! ( "Argument '{}' unknown" , other) ;
259
275
break ;
@@ -298,6 +314,10 @@ fn main() {
298
314
}
299
315
}
300
316
317
+ if let Some ( delay) = startup_delay {
318
+ std:: thread:: sleep ( delay) ;
319
+ }
320
+
301
321
// If the user didn't specify an action, print the usage instructions and
302
322
// exit
303
323
if !has_action {
You can’t perform that action at this time.
0 commit comments