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.
This commit is contained in:
Ben S 2015-11-19 12:47:53 +00:00
parent 41905eaba4
commit 1756a0a841

View File

@ -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))
}
}
};