1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-11-23 21:54:45 +02:00

Add --no-filename flag.

When this flag is set, a filename is never shown for a match.

Closes #20
This commit is contained in:
Andrew Gallant
2016-09-24 19:23:19 -04:00
parent 7b860affbe
commit a6e3cab65a
4 changed files with 30 additions and 0 deletions

View File

@@ -652,6 +652,18 @@ clean!(regression_65, "xyz", ".", |wd: WorkDir, mut cmd: Command| {
wd.assert_err(&mut cmd);
});
// See: https://github.com/BurntSushi/ripgrep/issues/20
sherlock!(feature_20, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| {
cmd.arg("--no-filename");
let lines: String = wd.stdout(&mut cmd);
let expected = "\
For the Doctor Watsons of this world, as opposed to the Sherlock
be, to a very large extent, the result of luck. Sherlock Holmes
";
assert_eq!(lines, expected);
});
#[test]
fn binary_nosearch() {
let wd = WorkDir::new("binary_nosearch");