1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/crates/cli
Roey Darwish Dror 020c5453a5
cli: fix stdin detection for Powershell on Unix
It seems that PowerShell uses sockets instead of FIFOs to redirect the
output between commands. So add `is_socket` to our `is_readable_stdin`
check.

This seems unlikely to cause problems and it probably more generally
correct than what we had before. In theory, it could cause problems if
it produces false positives, in which case, ripgrep will try to read
stdin when it should search the current working directory. (And this
usually winds up manifesting as ripgrep blocking forever.) But, if the
stdin handle reports itself as a socket, then it seems like we should
read it.

Fixes #1741, Closes #1742
2020-11-23 10:23:34 -05:00
..
src cli: fix stdin detection for Powershell on Unix 2020-11-23 10:23:34 -05:00
Cargo.toml grep-cli-0.1.5 2020-05-29 09:14:18 -04:00
LICENSE-MIT repo: move all source code in crates directory 2020-02-17 19:24:53 -05:00
README.md doc: update CI links in crate READMEs 2020-11-16 19:07:16 -05:00
UNLICENSE repo: move all source code in crates directory 2020-02-17 19:24:53 -05:00

grep-cli

A utility library that provides common routines desired in search oriented command line applications. This includes, but is not limited to, parsing hex escapes, detecting whether stdin is readable and more. To the extent possible, this crate strives for compatibility across Windows, macOS and Linux.

Build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/grep-cli

NOTE: You probably don't want to use this crate directly. Instead, you should prefer the facade defined in the grep crate.

Usage

Add this to your Cargo.toml:

[dependencies]
grep-cli = "0.1"

and this to your crate root:

extern crate grep_cli;