-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
allow number parameter for --head and --tail #233
Conversation
This allows one to specify a specific number of items to include in the --head and --tail options to the search command. This change is backwards-compatible in that the number parameter is optional. If the flag is called in the same way as it was before this change, the number is still assumed to be 10. In other words, the following continues to work, showing the first 10 results: ``` $ aura -As --head needle ``` The following now works as well, showing the first 3 results: ``` $ aura -As --head=3 needle ```
Aren't these equivalent? |
They're indeed equivalent. I just figured since the flags are already in aura it wouldn't hurt to add this optional parameter, especially since it allows one to specify the number in terms of results without having to worry about the description line. |
Piped to |
I've reviewed the code. Looks good. I liked your taking advantage of |
Haha thanks. I was thinking about how to best express that and I remembered about the monad :) |
My knee-jerk reaction is to attempt to express everything using Also, sorry |
Yeah, I really like applicative as well, but I came to the same conclusion. Yeah, didn't want to say anything but it took me a while to figure out what was what :) I just noticed the plans for Aura 2. I'm going to go over the design document when I have time. I'd love to help out wherever I can. |
By all means! And thanks for this patch. Also note that all current behaviour has to be added to the design doc as well. Kinda like an ultra man page. |
Allow numbered parameter for --head and --tail
Hey! I love aura and hope this is a welcome contribution!
This allows one to specify a specific number of items to include in the
--head
and--tail
options to the search command. This change is backwards-compatible in that the number parameter is optional. If the flag is called in the same way as it was before this change, the number is still assumed to be 10.In other words, the following continues to work, showing the first 10 results:
The following now works as well, showing the first 3 results:
The reason I made this was because the default value of 10 always scrolled the result I was interested in past my terminal height, since usually what I'm looking for is one of the first if not the first result.
It's working nicely :)