From 6afde85e18fc5e20d8deb92d96a7d2a93f975671 Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Thu, 6 Jul 2017 00:52:27 +0100 Subject: [PATCH] Document --time-style, and completions --- README.md | 2 ++ contrib/completions.bash | 5 +++++ contrib/completions.fish | 10 ++++++++-- contrib/completions.zsh | 1 + contrib/man/exa.1 | 5 +++++ src/options/help.rs | 3 ++- xtests/help | 1 + xtests/help_long | 1 + 8 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 312045d..2ad0b6e 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,12 @@ These options are available when running with --long (`-l`): - **-U**, **--created**: use the created timestamp field - **-@**, **--extended**: list each file's extended attributes and sizes - **--git**: list each file's Git status, if tracked +- **--time-style**: how to format timestamps - Valid **--color** options are **always**, **automatic**, and **never**. - Valid sort fields are **accessed**, **created**, **extension**, **Extension**, **inode**, **modified**, **name**, **Name**, **size**, **type**, and **none**. Fields starting with a capital letter are case-sensitive. - Valid time fields are **modified**, **accessed**, and **created**. +- Valid time styles are **default**, **iso**, **long-iso**, and **full-iso**. ## Installation diff --git a/contrib/completions.bash b/contrib/completions.bash index 47ea47f..9a54c23 100644 --- a/contrib/completions.bash +++ b/contrib/completions.bash @@ -22,6 +22,11 @@ _exa() COMPREPLY=( $( compgen -W 'accessed modified created --' -- $cur ) ) return ;; + + --time-style) + COMPREPLY=( $( compgen -W 'default iso long-iso full-iso --' -- $cur ) ) + return + ;; esac case "$cur" in diff --git a/contrib/completions.fish b/contrib/completions.fish index 9f0d628..5622494 100644 --- a/contrib/completions.fish +++ b/contrib/completions.fish @@ -55,8 +55,14 @@ complete -c exa -s 't' -l 'time' -x -d "Which timestamp field to list" -a " created\t'Display created time' modified\t'Display modified time' " -complete -c exa -s 'u' -l 'accessed' -d "Use the accessed timestamp field" -complete -c exa -s 'U' -l 'created' -d "Use the created timestamp field" +complete -c exa -s 'u' -l 'accessed' -d "Use the accessed timestamp field" +complete -c exa -s 'U' -l 'created' -d "Use the created timestamp field" +complete -c exa -l 'time-style' -x -d "How to format timestamps" -a " + default\t'Use the default time style' + iso\t'Display brief ISO timestamps' + long-iso\t'Display longer ISO timestaps, up to the minute' + full-iso\t'Display full ISO timestamps, up to the nanosecond' +" # Optional extras complete -c exa -s 'g' -l 'git' -d "List each file's Git status, if tracked" diff --git a/contrib/completions.zsh b/contrib/completions.zsh index e128775..0f5f04d 100644 --- a/contrib/completions.zsh +++ b/contrib/completions.zsh @@ -29,6 +29,7 @@ __exa() { {-m,--modified}"[Use the modified timestamp field]" \ {-S,--blocks}"[List each file's number of filesystem blocks]" \ {-t,--time}"[Which time field to show]:(time field):(accessed created modified)" \ + --time-style"[How to format timestamps]:(time style):(default iso long-iso full-iso)" \ {-u,--accessed}"[Use the accessed timestamp field]" \ {-U,--created}"[Use the created timestamp field]" \ --git"[List each file's Git status, if tracked]" \ diff --git a/contrib/man/exa.1 b/contrib/man/exa.1 index 33b1a8b..8ef83b9 100644 --- a/contrib/man/exa.1 +++ b/contrib/man/exa.1 @@ -145,6 +145,11 @@ which timestamp field to list (modified, accessed, created) .RS .RE .TP +.B \-\-time\-style=\f[I]STYLE\f[] +how to format timestamps (default, iso, long-iso, full-iso) +.RS +.RE +.TP .B \-u, \-\-accessed use the accessed timestamp field .RS diff --git a/src/options/help.rs b/src/options/help.rs index a391b9c..3d5e871 100644 --- a/src/options/help.rs +++ b/src/options/help.rs @@ -40,7 +40,8 @@ LONG VIEW OPTIONS -S, --blocks show number of file system blocks -t, --time FIELD which timestamp field to list (modified, accessed, created) -u, --accessed use the accessed timestamp field - -U, --created use the created timestamp field"##; + -U, --created use the created timestamp field + --time-style how to format timestamps (default, iso, long-iso, full-iso)"##; static GIT_HELP: &str = r##" --git list each file's Git status, if tracked"##; static EXTENDED_HELP: &str = r##" -@, --extended list each file's extended attributes and sizes"##; diff --git a/xtests/help b/xtests/help index 3e2f39a..a0ddf71 100644 --- a/xtests/help +++ b/xtests/help @@ -38,5 +38,6 @@ LONG VIEW OPTIONS -t, --time FIELD which timestamp field to list (modified, accessed, created) -u, --accessed use the accessed timestamp field -U, --created use the created timestamp field + --time-style how to format timestamps (default, iso, long-iso, full-iso) --git list each file's Git status, if tracked -@, --extended list each file's extended attributes and sizes diff --git a/xtests/help_long b/xtests/help_long index e952ea0..343de42 100644 --- a/xtests/help_long +++ b/xtests/help_long @@ -14,5 +14,6 @@ LONG VIEW OPTIONS -t, --time FIELD which timestamp field to list (modified, accessed, created) -u, --accessed use the accessed timestamp field -U, --created use the created timestamp field + --time-style how to format timestamps (default, iso, long-iso, full-iso) --git list each file's Git status, if tracked -@, --extended list each file's extended attributes and sizes