Skip to content

Time aliases #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ Options:
Which kind of timestamp to use; modified by default

Possible values:
- create: Timestamp showing when the file was created
- access: Timestamp showing when the file was last accessed
- mod: Timestamp showing when the file was last modified
- create: Time created (alias: ctime)
- access: Time last accessed (alias: atime)
- mod: Time last modified (alias: mtime)

--time-format <TIME_FORMAT>
Which format to use for the timestamp; default by default
Expand Down Expand Up @@ -676,13 +676,13 @@ Currently only available on Unix-like platforms. Support for Windows is planned.
--octal
Show permissions in numeric octal format instead of symbolic

--time <TIME>
--time <TIME>
Which kind of timestamp to use; modified by default

Possible values:
- create: Timestamp showing when the file was created
- access: Timestamp showing when the file was last accessed
- mod: Timestamp showing when the file was last modified
- create: Time created (alias: ctime)
- access: Time last accessed (alias: atime)
- mod: Time last modified (alias: mtime)

--time-format <TIME_FORMAT>
Which format to use for the timestamp; default by default
Expand Down
9 changes: 6 additions & 3 deletions src/context/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ use clap::ValueEnum;
/// Different types of timestamps available in long-view.
#[derive(Copy, Clone, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord, Default)]
pub enum Stamp {
/// Timestamp showing when the file was created.
/// Time created (alias: ctime)
#[value(alias("ctime"))]
Create,

/// Timestamp showing when the file was last accessed.
/// Time last accessed (alias: atime)
#[value(alias("atime"))]
Access,

/// Timestamp showing when the file was last modified.
/// Time last modified (alias: mtime)
#[default]
#[value(alias("mtime"))]
Mod,
}

Expand Down