mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-15 16:57:08 +00:00
Remove year field on timestamp column
It's now in the locals of the Table struct, and didn't really belong in the column anyway.
This commit is contained in:
parent
7f48748e70
commit
5af0f5793e
@ -11,7 +11,7 @@ use unicode_width::UnicodeWidthStr;
|
|||||||
pub enum Column {
|
pub enum Column {
|
||||||
Permissions,
|
Permissions,
|
||||||
FileSize(SizeFormat),
|
FileSize(SizeFormat),
|
||||||
Timestamp(TimeType, i64),
|
Timestamp(TimeType),
|
||||||
Blocks,
|
Blocks,
|
||||||
User,
|
User,
|
||||||
Group,
|
Group,
|
||||||
@ -46,15 +46,15 @@ impl Column {
|
|||||||
/// to have a header row printed.
|
/// to have a header row printed.
|
||||||
pub fn header(&self) -> &'static str {
|
pub fn header(&self) -> &'static str {
|
||||||
match *self {
|
match *self {
|
||||||
Column::Permissions => "Permissions",
|
Column::Permissions => "Permissions",
|
||||||
Column::FileSize(_) => "Size",
|
Column::FileSize(_) => "Size",
|
||||||
Column::Timestamp(t, _) => t.header(),
|
Column::Timestamp(t) => t.header(),
|
||||||
Column::Blocks => "Blocks",
|
Column::Blocks => "Blocks",
|
||||||
Column::User => "User",
|
Column::User => "User",
|
||||||
Column::Group => "Group",
|
Column::Group => "Group",
|
||||||
Column::HardLinks => "Links",
|
Column::HardLinks => "Links",
|
||||||
Column::Inode => "inode",
|
Column::Inode => "inode",
|
||||||
Column::GitStatus => "Git",
|
Column::GitStatus => "Git",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,6 @@ use std::os::unix::fs::MetadataExt;
|
|||||||
use getopts;
|
use getopts;
|
||||||
use natord;
|
use natord;
|
||||||
|
|
||||||
use datetime::local::{LocalDateTime, DatePiece};
|
|
||||||
|
|
||||||
use self::Misfire::*;
|
use self::Misfire::*;
|
||||||
|
|
||||||
/// The *Options* struct represents a parsed version of the user's
|
/// The *Options* struct represents a parsed version of the user's
|
||||||
@ -555,18 +553,16 @@ impl Columns {
|
|||||||
columns.push(Group);
|
columns.push(Group);
|
||||||
}
|
}
|
||||||
|
|
||||||
let current_year = LocalDateTime::now().year();
|
|
||||||
|
|
||||||
if self.time_types.modified {
|
if self.time_types.modified {
|
||||||
columns.push(Timestamp(TimeType::FileModified, current_year));
|
columns.push(Timestamp(TimeType::FileModified));
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.time_types.created {
|
if self.time_types.created {
|
||||||
columns.push(Timestamp(TimeType::FileCreated, current_year));
|
columns.push(Timestamp(TimeType::FileCreated));
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.time_types.accessed {
|
if self.time_types.accessed {
|
||||||
columns.push(Timestamp(TimeType::FileAccessed, current_year));
|
columns.push(Timestamp(TimeType::FileAccessed));
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg!(feature="git") {
|
if cfg!(feature="git") {
|
||||||
|
@ -183,15 +183,15 @@ impl Table {
|
|||||||
|
|
||||||
fn display(&mut self, file: &File, column: &Column) -> Cell {
|
fn display(&mut self, file: &File, column: &Column) -> Cell {
|
||||||
match *column {
|
match *column {
|
||||||
Column::Permissions => self.render_permissions(file.permissions()),
|
Column::Permissions => self.render_permissions(file.permissions()),
|
||||||
Column::FileSize(fmt) => self.render_size(file.size(), fmt),
|
Column::FileSize(fmt) => self.render_size(file.size(), fmt),
|
||||||
Column::Timestamp(t, _) => self.render_time(file.timestamp(t)),
|
Column::Timestamp(t) => self.render_time(file.timestamp(t)),
|
||||||
Column::HardLinks => self.render_links(file.links()),
|
Column::HardLinks => self.render_links(file.links()),
|
||||||
Column::Inode => self.render_inode(file.inode()),
|
Column::Inode => self.render_inode(file.inode()),
|
||||||
Column::Blocks => self.render_blocks(file.blocks()),
|
Column::Blocks => self.render_blocks(file.blocks()),
|
||||||
Column::User => self.render_user(file.user()),
|
Column::User => self.render_user(file.user()),
|
||||||
Column::Group => self.render_group(file.group()),
|
Column::Group => self.render_group(file.group()),
|
||||||
Column::GitStatus => self.render_git_status(file.git_status()),
|
Column::GitStatus => self.render_git_status(file.git_status()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user