← Back to davo.co
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md27
1 files changed, 21 insertions, 6 deletions
diff --git a/README.md b/README.md
index 3a93e75..22edd53 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,15 @@
# ud
-A clean, minimalist, robust C utility designed to automate Debian-based Linux system maintenance tasks. It manages `apt` package list updates, performs conditional upgrades, purges orphaned dependencies, clears package caches, and cleans local user thumbnail and screenshot caches.
+A clean, minimalist, robust C utility designed to automate Debian-based Linux system maintenance tasks. It manages `apt` package list updates, performs conditional upgrades, purges orphaned dependencies, clears package caches, and cleans local user thumbnail and screenshot directories while logging execution metrics.
## Features
- **Automated APT Maintenance:** Updates repository indices, checks for upgradeable packages, and runs `apt full-upgrade` only when updates exist.
- **Dependency & Cache Cleanup:** Automatically purges unused dependencies and lingering configuration files (`apt autoremove --purge`) and empties cached installer packages (`apt clean`).
- **User Cache Housekeeping:** Safely cleans desktop thumbnail caches and user screenshot directories without failing if the directories are empty.
-- **Robust POSIX C Implementation:** Built using strict standard C (`-std=c11`, POSIX 2008) with explicit bounds checking on formatted buffers and POSIX exit status inspection (`WIFEXITED`, `WEXITSTATUS`).
+- **Persistent Summary Logging:** Automatically writes session timestamps and task completion metrics (item counts purged/deleted) to `~/.local/state/ud/ud.log` following XDG Base Directory standards.
+- **CLI Management Flags:** Built-in option parsing (`getopt_long`) to view logs with your system `$PAGER`, clear log files, or inspect utility version information.
+- **Robust POSIX C Implementation:** Built using standard C (`-std=c11`, POSIX 2008) with explicit bounds checking on formatted buffers and POSIX exit status inspection (`WIFEXITED`, `WEXITSTATUS`).
- **Hardened & Optimized Build:** Compiled with `-O3`, `-flto`, `-march=native`, stack protection (`-fstack-protector-strong`), runtime buffer fortification (`-D_FORTIFY_SOURCE=2`), and strict warning checks (`-Wall -Wextra -Wpedantic -Werror`).
- **Clean Terminal Output:** Indents subprocess output using `sed` for a clear, readable terminal log.
@@ -60,9 +62,22 @@ make uninstall
Run the utility directly from your terminal:
```bash
-# Run directly from the source directory
-./ud
-
-# Or run from anywhere if ~/.local/bin is in your $PATH
+# Execute standard maintenance routine
ud
+
+# View persistent maintenance log using $PAGER (defaults to less)
+ud -v
+ud --view-log
+
+# Clear log history (~/.local/state/ud/ud.log)
+ud -c
+ud --clear-log
+
+# Display utility version
+ud -V
+ud --version
+
+# Display help message
+ud -h
+ud --help
```