This repository was archived by the owner on Feb 8, 2024. It is now read-only.
File tree 2 files changed +6
-7
lines changed
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 28
28
//! ```
29
29
30
30
use anyhow:: Result ;
31
- use enigo:: { Enigo , Key , MouseControllable , KeyboardControllable } ;
32
- use std:: { thread, time:: Duration } ;
33
31
use derive_builder:: Builder ;
32
+ use enigo:: { Enigo , Key , KeyboardControllable , MouseControllable } ;
33
+ use std:: { thread, time:: Duration } ;
34
34
35
35
mod sys;
36
36
@@ -80,7 +80,7 @@ pub struct KeepActive {
80
80
_imp : sys:: KeepActive ,
81
81
}
82
82
83
- // TODO: gradual movement
83
+ // TODO: gradual movement
84
84
// exit gracefully on Ctrl+C
85
85
pub fn simulate_activity ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
86
86
let mut enigo = Enigo :: new ( ) ;
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ use clap_complete::{generate, Shell};
12
12
use shadow_rs:: shadow;
13
13
use sysinfo:: { Pid , ProcessRefreshKind , System } ;
14
14
15
- use keep_active:: Builder ;
16
15
use keep_active:: simulate_activity;
16
+ use keep_active:: Builder ;
17
17
18
18
shadow ! ( build) ;
19
19
@@ -34,7 +34,7 @@ struct Cli {
34
34
sleep : bool ,
35
35
36
36
/// Keep status trackers active
37
- #[ arg( short = 'a' , long) ] // Changed short option for status_active
37
+ #[ arg( short = 'a' , long) ] // Changed short option for status_active
38
38
status_active : bool ,
39
39
40
40
/// Generate shell completions
@@ -43,15 +43,14 @@ struct Cli {
43
43
44
44
/// Wait for the process with the specified PID to exit.
45
45
/// This option is ignored when used with the COMMAND argument.
46
- #[ arg( short = 'w' , value_name = "PID" ) ] // Changed short option for wait
46
+ #[ arg( short = 'w' , value_name = "PID" ) ] // Changed short option for wait
47
47
wait : Option < u32 > ,
48
48
49
49
/// Run the command and wait for it to exit, keeping the computer awake while it runs.
50
50
#[ arg( trailing_var_arg = true , value_hint = ValueHint :: CommandWithArguments ) ]
51
51
command : Vec < String > ,
52
52
}
53
53
54
-
55
54
fn main ( ) -> Result < ( ) > {
56
55
let cli = Cli :: parse ( ) ;
57
56
You can’t perform that action at this time.
0 commit comments