rgwood / systemctl-tui

A fast, simple TUI for interacting with systemd services and their logs
MIT License
235 stars 5 forks source link

Add option to limit view to certain units #21

Closed mkuehlke closed 3 months ago

mkuehlke commented 3 months ago

Hi, I've had an itch to have an overview for some application consisting of over a dozen unit files, so I've searched for something like this. I'm just submitting this as a draft so you or others can have look to see if it's interesting.

This allows a user to limit the view to certain units, which makes it usable as a simple service front end for complex services:

systemctl-tui --limit-units abc\*.{service,timer} bce.service

This also allows one to show other unit types besides just .service. The UI doesn't support those, of course, but it seems to work fine with timers for now. And didn't even crash for .mount.

Caveats: Other unit types besides service aren't fully supported by the rest of the app. Maybe using a short option for such a niche use case isn't really necessary. Also I'm a complete newbie in Rust, so this may leak memory or other fluids.

rgwood commented 3 months ago

Thanks for the PR! I think this is a good idea. I'll try to review it this week.