diff options
author | Ben S <ogham@bsago.me> | 2015-11-19 12:47:53 +0000 |
---|---|---|
committer | Ben S <ogham@bsago.me> | 2015-11-19 12:47:53 +0000 |
commit | 1756a0a84157b17676268d730f2faa3151d7cd4a (patch) | |
tree | 1ca098984df23d6002c5fae1be691dffb9223278 /src | |
parent | 41905eaba44e32c226b627128b98ef8a839c32c5 (diff) |
Fix bug where details view needed a terminal width
The buggy code assumed that, if output isn't to a terminal, then the only view available is the Lines view. This is incorrect, as the Details view doesn't require a set width either, so check for --long even when there's no set width.
Diffstat (limited to 'src')
-rw-r--r-- | src/options.rs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/options.rs b/src/options.rs index 8764b47..72996bc 100644 --- a/src/options.rs +++ b/src/options.rs @@ -265,11 +265,25 @@ impl View { TerminalColours::Automatic => Colours::plain(), }; - let lines = Lines { - colours: colours, - }; + if matches.opt_present("tree") { + let details = Details { + columns: None, + header: false, + recurse: dir_action.recurse_options(), + filter: filter, + xattr: false, + colours: colours, + }; - Ok(View::Lines(lines)) + Ok(View::Details(details)) + } + else { + let lines = Lines { + colours: colours, + }; + + Ok(View::Lines(lines)) + } } }; |