Add -l option and align pipe separators in edit mode

Extract printCrontabContent() shared by both -e and new -l, collecting
job data into arrays first so column widths can be computed for aligned
pipe separators. -l prints the same crontab format to stdout without
opening an editor, useful for scripting and quick inspection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthias Johnson 2026-02-28 00:26:40 -07:00
parent 57d2c38d3c
commit 8368f1dcf7
2 changed files with 90 additions and 61 deletions

View file

@ -131,6 +131,9 @@ Disable/enable work the same as for timer jobs — disable stops the service and
### Managing jobs
```bash
# Print all jobs in crontab-like format to stdout (useful for scripting)
systab -l
# Edit all jobs in your $EDITOR (crontab-style)
systab -e
@ -206,6 +209,7 @@ Management (accept hex ID or name):
-D <id|name> Disable a job
-E <id|name> Enable a disabled job
-e Edit jobs in crontab-like format
-l Print jobs in crontab-like format to stdout
-L [id|name] [filter] List job logs (optionally for a specific job and/or filtered)
-S [id|name] Show status of all managed jobs (or a specific job)
-C Clean up completed one-time jobs