Instead of upgrading from clap3 to clap4 (which seems to change their
interface every year or so), switch to the much smaller pico-args. (Same
as we did for termproxy recently, see [0])
It has almost all features we need (except producing help output) and
supports OsString, but wihout any dependencies. This decreases compile
time and reduces the size of the resulting binary. It also reduces the
lines of code.
The only difference is now the different output for errors, e.g. for
missing values of options.
Help output is copied from the old clap output.
0: https://git.proxmox.com/?p=pve-xtermjs.git;a=commitdiff;h=24d707d0506b120a085b06b5f2b6000696879a1e
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
Adds `proxmox-time` as dependency to parse the timestamp
Since parse_rfc3339 can't handle microseconds, we try to remove the dot
followed by 6 digits of microseconds before passing it to parse_rfc3339.
A fallback to the previous format is used when when it fails to parse
the new format.
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
only relevant change is the assertion that multiple(true) takes a
value, so we need to change to the new actions system.
Note that with 3.2.20+ we could switch to args.get_count("verbose")
saving us the unwrap/dereference dance.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
We're using a very old version of it and the functions we
actually use are available in glibc anyway.
The only difference I found was that the result of
glibc's `strptime()`'s `%s` does *not* want an additional
`.to_local()` call anymore...
... which was weird anyway.
As a minor optimization I pass the format string as `&CStr`
to avoid the memcpy.
(The CString::new() call in `strptime()` only happens during
parameter parsing)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
[dropped left-over and fixed FIXME]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
pmg-log-tracker has been rewritten in Rust. Functionality is the same.
Output sometimes has a different order than the pmg-log-tracker in C.
This only happens when the time of the entries match.
There's one change regarding the interface. In addition to the short
versions of arguments also long versions exist.
The implementation uses Rc<>, Weak<> and RefCell<> to make holding mutable
cross-references possible, without having to change the original logic
completely. This allowed for easier translation from C to Rust.
The file debian/cargo-checksum.json is required by dh-cargo, otherwise
it won't compile. The cargo-checksum.json should contain the upstream
.crate file which does not exist in this case, so we just create an
empty one with the required keys. (see 'Library package structure' in
https://wiki.debian.org/Teams/RustPackaging/Policy)
The change to the minimum version of debhelper required was done
according to other rust packages (rust-clap, rust-bindgen, rust-ripgrep).
Adds a README that provides an overview of the stages a mail passes
through and what we can use to match those together for a single mail.
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>