summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-04-22 14:17:12 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-04-22 14:17:12 +0200
commit10b71864f630b86b8990caff201fb21b0663926b (patch)
tree0dc69a7419e8b7a7086a6ffe31b9f7a6c7a9998b
parent495ad62be63b527588ac9a87066f25dda06e8235 (diff)
Fix: Do not automatically wrap text
We must use `ArgMatches::occurrences_of` here to check whether the argument was actually passed. If it was not passed, we do not wrap at all.
-rw-r--r--bin/core/imag-view/src/main.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/core/imag-view/src/main.rs b/bin/core/imag-view/src/main.rs
index e8241be6..15d5bbf3 100644
--- a/bin/core/imag-view/src/main.rs
+++ b/bin/core/imag-view/src/main.rs
@@ -173,7 +173,7 @@ fn main() {
} else {
let mut viewer = StdoutViewer::new(view_header, !hide_content);
- if rt.cli().is_present("autowrap") {
+ if rt.cli().occurrences_of("autowrap") != 0 {
let width = rt.cli().value_of("autowrap").unwrap(); // ensured by clap
let width = usize::from_str(width).unwrap_or_else(|e| {
error!("Failed to parse argument to number: autowrap = {:?}",