From 46a3e59e66dc91c8cb2f30899d9dc2eef11fab12 Mon Sep 17 00:00:00 2001 From: b05902132 <32428261+b05902132@users.noreply.github.com> Date: Sat, 20 Mar 2021 08:26:53 +0800 Subject: [PATCH] Some minor fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mélanie Chauvel Also add more spaces to make the descriptions of other options align that of `-n`. --- completions/completions.fish | 2 +- src/options/help.rs | 42 ++++++++++++++++++------------------ src/options/view.rs | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/completions/completions.fish b/completions/completions.fish index e540a57..b84b50f 100755 --- a/completions/completions.fish +++ b/completions/completions.fish @@ -65,7 +65,7 @@ complete -c exa -s 't' -l 'time' -x -d "Which timestamp field to list" -a " created\t'Display created time' " complete -c exa -s 'm' -l 'modified' -d "Use the modified timestamp field" -complete -c -exa -s 'n' -l 'numeric-uid-gid' -d "List numeric user and group IDs." +complete -c exa -s 'n' -l 'numeric-uid-gid' -d "List numeric user and group IDs." complete -c exa -l 'changed' -d "Use the changed 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" diff --git a/src/options/help.rs b/src/options/help.rs index 7c091f8..2165a8a 100644 --- a/src/options/help.rs +++ b/src/options/help.rs @@ -39,28 +39,28 @@ FILTERING AND SORTING OPTIONS date, time, old, and new all refer to modified. LONG VIEW OPTIONS - -b, --binary list file sizes with binary prefixes - -B, --bytes list file sizes in bytes, without any prefixes - -g, --group list each file's group - -h, --header add a header row to each column - -H, --links list each file's number of hard links - -i, --inode list each file's inode number - -m, --modified use the modified timestamp field - -n, --numeric-uid-gid list numeric user and group IDs - -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 - --changed use the changed timestamp field - --time-style how to format timestamps (default, iso, long-iso, full-iso) - --no-permissions suppress the permissions field - --octal-permissions list each file's permission in octal format - --no-filesize suppress the filesize field - --no-user suppress the user field - --no-time suppress the time field"##; + -b, --binary list file sizes with binary prefixes + -B, --bytes list file sizes in bytes, without any prefixes + -g, --group list each file's group + -h, --header add a header row to each column + -H, --links list each file's number of hard links + -i, --inode list each file's inode number + -m, --modified use the modified timestamp field + -n, --numeric-uid-gid list numeric user and group IDs + -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 + --changed use the changed timestamp field + --time-style how to format timestamps (default, iso, long-iso, full-iso) + --no-permissions suppress the permissions field + --octal-permissions list each file's permission in octal format + --no-filesize suppress the filesize field + --no-user suppress the user field + --no-time suppress the time field"##; -static GIT_HELP: &str = r##" --git list each file's Git status, if tracked or ignored"##; -static EXTENDED_HELP: &str = r##" -@, --extended list each file's extended attributes and sizes"##; +static GIT_HELP: &str = r##" --git list each file's Git status, if tracked or ignored"##; +static EXTENDED_HELP: &str = r##" -@, --extended list each file's extended attributes and sizes"##; /// All the information needed to display the help text, which depends diff --git a/src/options/view.rs b/src/options/view.rs index 96aaec6..2953ea9 100644 --- a/src/options/view.rs +++ b/src/options/view.rs @@ -266,12 +266,12 @@ impl TimeFormat { } } + impl UserFormat { fn deduce(matches: &MatchedFlags<'_>) -> Result { let flag = matches.has(&flags::NUM_UGID)?; Ok(if flag { Self::Numeric } else { Self::Name }) } - }