diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 13:44:21 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-21 13:44:21 +1200 |
commit | c2f05c595dfe71a60f48e14635af191c07bf6980 (patch) | |
tree | edb81cac412dce04c6ba8547c95de97e03bc360b /sh/shrc.d/ls.sh | |
parent | Clean up/extend grep()/ls() extension (diff) | |
download | dotfiles-c2f05c595dfe71a60f48e14635af191c07bf6980.tar.gz dotfiles-c2f05c595dfe71a60f48e14635af191c07bf6980.zip |
Adjust ordering of ls() and grep() options
Diffstat (limited to 'sh/shrc.d/ls.sh')
-rw-r--r-- | sh/shrc.d/ls.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh index 57f6ed24..8fd42431 100644 --- a/sh/shrc.d/ls.sh +++ b/sh/shrc.d/ls.sh @@ -5,22 +5,23 @@ # Define function proper ls() { - # Add --time-style='+%Y-%m-%d %H:%M:%S' to show trailing indicators of the filetype - [ -e "$HOME"/.cache/ls/time-style ] && - set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@" + # Add --block-size=K to always show the filesize in kibibytes + [ -e "$HOME"/.cache/ls/block-size ] && + set -- --block-size=K "$@" + + # Add --classify to show trailing indicators of the filetype + [ -e "$HOME"/.cache/ls/classify ] && + set -- --classify "$@" # Add --color if the terminal has at least 8 colors [ -e "$HOME"/.cache/ls/color ] && [ "$({ tput colors || tput Co ; } 2>/dev/null)" -ge 8 ] && set -- --color=auto "$@" - # Add --classify to show trailing indicators of the filetype - [ -e "$HOME"/.cache/ls/classify ] && - set -- --classify "$@" - - # Add --block-size=K to always show the filesize in kibibytes - [ -e "$HOME"/.cache/ls/block-size ] && - set -- --block-size=K "$@" + # Add --time-style='+%Y-%m-%d %H:%M:%S' to show trailing indicators of the + # filetype + [ -e "$HOME"/.cache/ls/time-style ] && + set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@" # Run ls(1) with the concluded arguments command ls "$@" |