diff --git a/Cargo.toml b/Cargo.toml index 725976f..82a9a4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ exclude = [ "build", "debian" ] [dependencies] anyhow = "1" -clap = { version = "3.2.23", features = ["cargo"] } flate2 = "1.0" libc = "0.2" proxmox-time = "1.1" +pico-args = { version = "0.4", features = ["combined-flags"] } diff --git a/src/main.rs b/src/main.rs index e55f17b..e7aeeb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,111 +13,55 @@ use anyhow::{bail, Error}; use flate2::read; use libc::time_t; -use clap::{App, Arg}; - mod time; use time::{Tm, CAL_MTOD}; +fn print_usage() { + let pkg_version = env!("CARGO_PKG_VERSION"); + println!( + "\ +pmg-log-tracker {pkg_version} +Proxmox Mailgateway Log Tracker. Tool to scan mail logs. + +USAGE: + pmg-log-tracker [OPTIONS] + +OPTIONS: + -e, --endtime