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

Feature Request: Option to show line numbers #180

Closed
jpillora opened this issue Aug 31, 2014 · 6 comments
Closed

Feature Request: Option to show line numbers #180

jpillora opened this issue Aug 31, 2014 · 6 comments

Comments

@jpillora
Copy link

When filtering, it might be nice to know where you are inside a large file

@lestrrat
Copy link
Contributor

What happens if you are doing something line tail -F /potentially/infinite/logfile' | peco?

@jpillora
Copy link
Author

I see the end of logfile with no line numbers :(

@lestrrat
Copy link
Contributor

Sorry, I meant,

"suppose we implement --show-line-numbers, and then what do you expect to happen if you do something like tail -F /potentially/infinite/logfile' | peco?"

@syohex
Copy link
Contributor

syohex commented Aug 31, 2014

FYI We can use nl command for this purpose without implementing --show-line-numbers
option. For example

% ps aux | nl -ba | peco | perl -wlne 'm{^\s+\d+\s(.*+)} and print $1'

line-number

@lestrrat
Copy link
Contributor

I prefer @syohex 's approach :)

@jpillora
Copy link
Author

@lestrrat True, though that'll always be an issue when you're just dealing with stdin. program-to-randomize-lines foo.txt | peco I think most people would know that you're not going to have correct line numbers. Anyway, I'll make a shell function with @syohex's solution.

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

No branches or pull requests

3 participants