Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slicing the result set start,stop,step #41

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

commonism
Copy link

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

 -l start:stop:step
e.g:
 -l 0:10 # top ten
 -l 10:0:-1 # top ten in reverse order
@Freaky
Copy link
Collaborator

Freaky commented Dec 29, 2022

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.

@commonism
Copy link
Author

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?

@Freaky
Copy link
Collaborator

Freaky commented Dec 30, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants