diff options
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs index 6a5f09f9..1a5b8a31 100644 --- a/src/args.rs +++ b/src/args.rs @@ -746,6 +746,7 @@ impl ArgMatches { .per_match(self.is_present("vimgrep")) .replacement(self.replacement()) .max_columns(self.max_columns()?) + .max_column_preview(self.max_column_preview()) .max_matches(self.max_count()?) .column(self.column()) .byte_offset(self.is_present("byte-offset")) @@ -1142,6 +1143,12 @@ impl ArgMatches { Ok(self.usize_of_nonzero("max-columns")?.map(|n| n as u64)) } + /// Returns true if and only if a preview should be shown for lines that + /// exceed the maximum column limit. + fn max_column_preview(&self) -> bool { + self.is_present("max-column-preview") + } + /// The maximum number of matches permitted. fn max_count(&self) -> Result<Option<u64>> { Ok(self.usize_of("max-count")?.map(|n| n as u64)) |