ioztat icon indicating copy to clipboard operation
ioztat copied to clipboard

slicing the result set start,stop,step

Open commonism opened this issue 3 years ago • 3 comments

this adds -l to slice the result set

-l start:stop:step e.g: -l 0:10 # top ten -l 10:0:-1 # top ten in reverse order

commonism avatar Aug 03 '22 05:08 commonism

This feels a bit weird for my taste. I'm not sure I see the utility in arbitrary slicing of results, and it's a remarkably unintuitive way of reversing sort order - that perhaps calls for a dedicated flag.

Freaky avatar Dec 29 '22 19:12 Freaky

It's even worse for -2.

I guess this is not about using slice, but you'd prefer dedicated arguments/parameters instead of the single start:stop:step slice parameter?

commonism avatar Dec 30 '22 18:12 commonism

Separate flags would be my preference, and they all need to be able to justify themselves.

e.g. for reversing sort order, ioztat -s operations in a terminal puts all the interesting stuff at the start of the output - which likely scrolls out of view in a lot of systems, so being able to put the biggest values at the end of the output seems justified.

For top-n results, I guess that can also be justified - it lets you size the displayed results without using -o, so you can get scrollback in results while having each one fit in your terminal.

I run out of steam when trying to think of a justification for arbitrary slices of results. Top-ten sorted? Fair enough. Top tenth through twentieth? Scratching my head on that one.

Freaky avatar Dec 30 '22 19:12 Freaky