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

-A and -B options are ignored when the input is STDIN #68

Open
shirayu opened this issue Nov 28, 2018 · 3 comments
Open

-A and -B options are ignored when the input is STDIN #68

shirayu opened this issue Nov 28, 2018 · 3 comments
Labels

Comments

@shirayu
Copy link
Contributor

shirayu commented Nov 28, 2018

This works well.

$  jvgrep -A1 vim ./README.md
./README.md:4:`jvgrep` is grep for Japanese vimmer. You can find text from files that written in another Japanese encodings.
./README.md:5:
---
./README.md:72:If you problem about output of jvgrep (ex: output of :grep command in vim), try to set $JVGREP_OUTPUT_ENCODING to specify encoding of output.
./README.md:73:
---
./README.md:87:Add following to your vimrc
./README.md:88:

However, -A and -B options are ignored when the input is STDIN.

$  cat README.md| jvgrep -A1 vim
`jvgrep` is grep for Japanese vimmer. You can find text from files that written in another Japanese encodings.
If you problem about output of jvgrep (ex: output of :grep command in vim), try to set $JVGREP_OUTPUT_ENCODING to specify encoding of output.
Add following to your vimrc
@mattn
Copy link
Owner

mattn commented Nov 28, 2018

Because STDIN is not seekable.

@shirayu
Copy link
Contributor Author

shirayu commented Nov 28, 2018

If jvgrep does not support these options for STDIN, how about showing a warning message and exit with some error status?
I think just ignoring them is confusing.

FYI: grep supports this.

$  cat README.md| grep -A1 vim
`jvgrep` is grep for Japanese vimmer. You can find text from files that written in another Japanese encodings.

--
If you problem about output of jvgrep (ex: output of :grep command in vim), try to set $JVGREP_OUTPUT_ENCODING to specify encoding of output.

--
Add following to your vimrc

@mattn
Copy link
Owner

mattn commented Nov 28, 2018

You're right. I beleived that grep doesn't support A/B for input stream.

@mattn mattn added the bug label Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants