cli icon indicating copy to clipboard operation
cli copied to clipboard

Feature: New option to push message every x lines(default 1)

Open toddejohnson opened this issue 1 year ago • 3 comments

I'm watching logs for some filesystems and want notified when there are new entries. I'm using:

`journalctl -kf | xargs -L 1 gotify p

That is working great! I'd like to make it integrated so as to not worry as much about buffering and to not need the xargs and be more portable for others.

Something like:

journalctl -kf | gotify p -L 1

And the option could be:

gotify push 
--lines value, -L value Push a message every 'value' lines (default: 1)

Would this be a good idea?

toddejohnson avatar Aug 02 '24 16:08 toddejohnson

What about pushing a message on every null character? It is more consistent with other unix tools and probably more flexible (you may have variable output but still want to hint to the cli when to send)

eternal-flame-AD avatar Aug 02 '24 20:08 eternal-flame-AD

@eternal-flame-AD What about a -0 option like xargs?

toddejohnson avatar Aug 02 '24 20:08 toddejohnson

That might be a good idea, I'm also considering implicitly doing that because I doubt people will intentionally push null characters. xargs needed that because they default to newline but we don't have that problem

eternal-flame-AD avatar Aug 02 '24 20:08 eternal-flame-AD