summaryrefslogtreecommitdiffstats
path: root/src/output/details.rs
diff options
context:
space:
mode:
authorBenjamin Sago <ogham@bsago.me>2020-10-23 23:57:10 +0100
committerBenjamin Sago <ogham@bsago.me>2020-10-23 23:57:10 +0100
commita1869f208e0e9141e8668e64b0742ddd139da9fa (patch)
treee831f6267dfa3b132fe5f084c7a3dc351ee39a8a /src/output/details.rs
parent800c73ff246bb57587dab930ddb73323d9584ca5 (diff)
Move common icons option to file style structview-options
All four of the view mode command-line argument parsers tested for the --icons option. Because it was common, the behaviour has been moved to the struct that handles file styles, meaning it can be parsed in one place. This is a better place for it, as the icons are to do with the file name, not the view. It also means that the lines view has no options left for it, which is fitting.
Diffstat (limited to 'src/output/details.rs')
-rw-r--r--src/output/details.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/output/details.rs b/src/output/details.rs
index a3a33ce..10f2404 100644
--- a/src/output/details.rs
+++ b/src/output/details.rs
@@ -106,9 +106,6 @@ pub struct Options {
/// Whether to show each file’s extended attributes.
pub xattr: bool,
-
- /// Whether icons mode is enabled.
- pub icons: bool,
}
@@ -269,8 +266,8 @@ impl<'a> Render<'a> {
}
};
- let icon = if self.opts.icons { Some(painted_icon(file, self.theme)) }
- else { None };
+ let icon = if self.file_style.icons { Some(painted_icon(file, self.theme)) }
+ else { None };
let egg = Egg { table_row, xattrs, errors, dir, file, icon };
unsafe { std::ptr::write(file_eggs.lock().unwrap()[idx].as_mut_ptr(), egg) }