summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2017-01-11 18:53:35 -0500
committerAndrew Gallant <jamslam@gmail.com>2017-01-11 18:53:35 -0500
commit7a951f103a2abeba5af53905e168a09179704b48 (patch)
tree83cee8bdfd1ce27760db0def305197f2044e67df /src
parentc3de1f58ea45fec442da21e9e1174e4269f64998 (diff)
Make --column imply --line-number.
Closes #243
Diffstat (limited to 'src')
-rw-r--r--src/app.rs3
-rw-r--r--src/args.rs1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/app.rs b/src/app.rs
index a353fdb9..e8ceeb56 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -315,7 +315,8 @@ lazy_static! {
"Show column numbers",
"Show column numbers (1-based). This only shows the column \
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",
"Set the context separator string. [default: --]",
"The string used to separate non-contiguous context lines in the \
diff --git a/src/args.rs b/src/args.rs
index 594ece09..6030964e 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -583,6 +583,7 @@ impl<'a> ArgMatches<'a> {
false
} else {
self.is_present("line-number")
+ || self.is_present("column")
|| atty::on_stdout()
|| self.is_present("pretty")
|| self.is_present("vimgrep")