aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-25 13:32:34 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-25 13:32:34 +1300
commitf5b0b481c3b5c6a1dfd089ec99582c0d5cc0e1b9 (patch)
tree255f6448137817c84e2c3ac06aa932478667fbbe /sh
parentAdd FreeBSD -G to ls() wrapper (diff)
downloaddotfiles-f5b0b481c3b5c6a1dfd089ec99582c0d5cc0e1b9.tar.gz
dotfiles-f5b0b481c3b5c6a1dfd089ec99582c0d5cc0e1b9.zip
Add -D option for FreeBSD ls()
Diffstat (limited to 'sh')
-rw-r--r--sh/shrc.d/ls.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index c7703663..0fc6923a 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -31,10 +31,14 @@ ls() {
[ -e "$HOME"/.cache/ls/time-style ] &&
set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@"
- # Add -G for colorized output if the operating system is FreeBSD
- # We have to check because -G means something else to e.g. GNU ls(1)
+ # If the operating system is FreeBSD, there are some specific options we
+ # can add that might mean different things to e.g. GNU ls(1)
case $OS in
- FreeBSD) set -- -G "$@" ;;
+ FreeBSD)
+ # -D: Timestamp format
+ # -G: Use color
+ set -- -D '%Y-%m-%d %H:%M:%S' -G "$@"
+ ;;
esac
# Run ls(1) with the concluded arguments