diff options
Diffstat (limited to 'karlc')
-rw-r--r-- | karlc/Cargo.toml | 12 | ||||
-rw-r--r-- | karlc/src/main.rs | 14 |
2 files changed, 13 insertions, 13 deletions
diff --git a/karlc/Cargo.toml b/karlc/Cargo.toml index 3bad351..b04426a 100644 --- a/karlc/Cargo.toml +++ b/karlc/Cargo.toml @@ -6,12 +6,12 @@ edition = "2021" [dependencies] karlcommon = { path = "../karlcommon" } -clap = { version = "3.1.18", features = ["derive"] } -serde = { version = "1.0.137", features = ["derive"] } -serde_json = "1.0.81" -env_logger = "0.9.0" +clap = { version = "4.0.27", features = ["derive"] } +serde = { version = "1.0.148", features = ["derive"] } +serde_json = "1.0.89" +env_logger = "0.10.0" log = "0.4.17" -crossbeam-channel = "0.5.4" -chrono = { version = "0.4.19", features = ["serde"] } +crossbeam-channel = "0.5.6" +chrono = { version = "0.4.23", features = ["serde"] } rand = "0.8.5" diff --git a/karlc/src/main.rs b/karlc/src/main.rs index 6ea540a..f4a4736 100644 --- a/karlc/src/main.rs +++ b/karlc/src/main.rs @@ -15,7 +15,7 @@ use std::{os::unix::net::UnixStream, path::PathBuf, process::exit}; #[clap(about, author, version)] struct Arguments { /// Custom path to the daemon socket - #[clap(long)] + #[arg(long)] socket_path: Option<PathBuf>, #[clap(subcommand)] action: Action, @@ -115,8 +115,8 @@ fn main() { scheduled .map(|r| format!( "{} - {}", - NaiveDateTime::from_timestamp(r.start, 0), - NaiveDateTime::from_timestamp(r.end, 0) + NaiveDateTime::from_timestamp_opt(r.start, 0).unwrap(), + NaiveDateTime::from_timestamp_opt(r.end, 0).unwrap() )) .unwrap_or("...".to_string()) ); @@ -124,8 +124,8 @@ fn main() { Schedule::Static(t) => { println!( "from {} to {}", - NaiveDateTime::from_timestamp(t.start, 0), - NaiveDateTime::from_timestamp(t.end, 0) + NaiveDateTime::from_timestamp_opt(t.start, 0).unwrap(), + NaiveDateTime::from_timestamp_opt(t.end, 0).unwrap() ) } Schedule::Condition(o) => { @@ -146,13 +146,13 @@ fn main() { i.start .map(|e| format!( "{}", - NaiveDateTime::from_timestamp(e, 0) + NaiveDateTime::from_timestamp_opt(e, 0).unwrap() )) .unwrap_or("...".to_string()), i.end .map(|e| format!( "{}", - NaiveDateTime::from_timestamp(e, 0) + NaiveDateTime::from_timestamp_opt(e, 0).unwrap() )) .unwrap_or("...".to_string()), ); |