mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
parent
c3de1f58ea
commit
7a951f103a
1
doc/rg.1
1
doc/rg.1
@ -183,6 +183,7 @@ Show column numbers (1 based) in output.
|
|||||||
This only shows the column numbers for the first match on each line.
|
This only shows the column numbers for the first match on each line.
|
||||||
Note that this doesn\[aq]t try to account for Unicode.
|
Note that this doesn\[aq]t try to account for Unicode.
|
||||||
One byte is equal to one column.
|
One byte is equal to one column.
|
||||||
|
This implies \-\-line\-number.
|
||||||
.RS
|
.RS
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
@ -126,7 +126,8 @@ Project home page: https://github.com/BurntSushi/ripgrep
|
|||||||
--column
|
--column
|
||||||
: Show column numbers (1 based) in output. This only shows the column
|
: Show column numbers (1 based) in output. This only shows the column
|
||||||
numbers for the first match on each line. Note that this doesn't try
|
numbers for the first match on each line. Note that this doesn't try
|
||||||
to account for Unicode. One byte is equal to one column.
|
to account for Unicode. One byte is equal to one column. This implies
|
||||||
|
--line-number.
|
||||||
|
|
||||||
--context-separator *SEPARATOR*
|
--context-separator *SEPARATOR*
|
||||||
: The string to use when separating non-continuous context lines. Escape
|
: The string to use when separating non-continuous context lines. Escape
|
||||||
|
@ -315,7 +315,8 @@ lazy_static! {
|
|||||||
"Show column numbers",
|
"Show column numbers",
|
||||||
"Show column numbers (1-based). This only shows the column \
|
"Show column numbers (1-based). This only shows the column \
|
||||||
numbers for the first match on each line. This does not try \
|
numbers for the first match on each line. This does not try \
|
||||||
to account for Unicode. One byte is equal to one column.");
|
to account for Unicode. One byte is equal to one column. This \
|
||||||
|
implies --line-number.");
|
||||||
doc!(h, "context-separator",
|
doc!(h, "context-separator",
|
||||||
"Set the context separator string. [default: --]",
|
"Set the context separator string. [default: --]",
|
||||||
"The string used to separate non-contiguous context lines in the \
|
"The string used to separate non-contiguous context lines in the \
|
||||||
|
@ -583,6 +583,7 @@ impl<'a> ArgMatches<'a> {
|
|||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
self.is_present("line-number")
|
self.is_present("line-number")
|
||||||
|
|| self.is_present("column")
|
||||||
|| atty::on_stdout()
|
|| atty::on_stdout()
|
||||||
|| self.is_present("pretty")
|
|| self.is_present("pretty")
|
||||||
|| self.is_present("vimgrep")
|
|| self.is_present("vimgrep")
|
||||||
|
@ -107,8 +107,8 @@ sherlock!(columns, |wd: WorkDir, mut cmd: Command| {
|
|||||||
cmd.arg("--column");
|
cmd.arg("--column");
|
||||||
let lines: String = wd.stdout(&mut cmd);
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
let expected = "\
|
let expected = "\
|
||||||
57:For the Doctor Watsons of this world, as opposed to the Sherlock
|
1:57:For the Doctor Watsons of this world, as opposed to the Sherlock
|
||||||
49:be, to a very large extent, the result of luck. Sherlock Holmes
|
3:49:be, to a very large extent, the result of luck. Sherlock Holmes
|
||||||
";
|
";
|
||||||
assert_eq!(lines, expected);
|
assert_eq!(lines, expected);
|
||||||
});
|
});
|
||||||
@ -781,7 +781,7 @@ clean!(regression_105_part2, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
|||||||
cmd.arg("--column");
|
cmd.arg("--column");
|
||||||
|
|
||||||
let lines: String = wd.stdout(&mut cmd);
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
assert_eq!(lines, "foo:3:zztest\n");
|
assert_eq!(lines, "foo:1:3:zztest\n");
|
||||||
});
|
});
|
||||||
|
|
||||||
// See: https://github.com/BurntSushi/ripgrep/issues/127
|
// See: https://github.com/BurntSushi/ripgrep/issues/127
|
||||||
@ -1214,6 +1214,15 @@ clean!(feature_159_zero_max, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
|||||||
wd.assert_err(&mut cmd);
|
wd.assert_err(&mut cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/243
|
||||||
|
clean!(feature_243_column_line, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
|
wd.create("foo", "test");
|
||||||
|
cmd.arg("--column");
|
||||||
|
|
||||||
|
let lines: String = wd.stdout(&mut cmd);
|
||||||
|
assert_eq!(lines, "foo:1:1:test\n");
|
||||||
|
});
|
||||||
|
|
||||||
// See: https://github.com/BurntSushi/ripgrep/issues/263
|
// See: https://github.com/BurntSushi/ripgrep/issues/263
|
||||||
clean!(feature_263_sort_files, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
clean!(feature_263_sort_files, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
||||||
wd.create("foo", "test");
|
wd.create("foo", "test");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user